Граф коммитов

7543 Коммитов

Автор SHA1 Сообщение Дата
Alain Jobart c31fd6a7a5 Merge pull request #2874 from alainjobart/mysql
Mysql connector: better memory management.
2017-05-23 07:15:05 -07:00
Michael Berlin 7dfd764609 Merge pull request #2879 from michael-berlin/improve_reset_error
vtworker: Improve error messages when users must 'Reset' the worker.
2017-05-23 16:06:53 +02:00
Michael Berlin e4eed5cd04 vtworker: Simplify calculation for grace period during which we return a retryable error.
I also tried to better document why we do this in the first place.
2017-05-23 04:21:03 -07:00
Michael Berlin 8ed948904d vtworker: Improve error message that user must run 'Reset' to clear the state. 2017-05-23 02:58:27 -07:00
Alain Jobart d1783bbbeb Changing mysql.ComQuery parameter to []byte.
So we minimize copies.
2017-05-22 14:08:36 -07:00
Alain Jobart 49029120da Refactoring ephemeral packets reads.
We now use the ephemeral policy for both reads and writes:
- renamed the write enums to have 'Write' in their names.
- added three enum types for reads.
- added a recycleReadPacket method, has to be called after a packet
has been fully read (and before starting any other packet).
2017-05-22 11:05:43 -07:00
Alain Jobart b573587593 Using ephemeral packets in two more places.
So we avoid a couple more memory allocations on handshake.
2017-05-22 09:13:05 -07:00
Michael Berlin c1d1690034 vttablet: Change comments, variables and help text to better reflect that the new method operates on a comma separated list. 2017-05-22 07:32:24 -07:00
Michael Berlin ca6ea8ffcf vttablet: Return errors instead of crashing the binary. 2017-05-22 07:24:10 -07:00
Jon Tirsen 22b00f7f6f Support multiple tablet types as binlog player source 2017-05-22 13:36:56 +02:00
Alain Jobart c6010169d6 Merge pull request #2870 from alainjobart/fixes
A few simple fixes: proto equals, slave connection error reporting, ...
2017-05-19 10:16:14 -07:00
Alain Jobart c5cad2bdde Fixing error reporting in replication connections. 2017-05-19 09:56:52 -07:00
Alain Jobart 6865686f5a Removing last mentions of mysqlconn. 2017-05-19 09:33:13 -07:00
Alain Jobart d807daa050 Fixing a few more proto equals.
BUG=37574309
2017-05-19 08:59:42 -07:00
Alex Charis 75f0728f2e use Subject Alternative Names from cert as immediate callerid groups (#2869)
* use DNSNames (Subject Alternative Names) from cert as immediate callerid Groups

* add no_test to grpcvtgateservice

* fix copy/paste errors, making comment accurate
2017-05-19 08:58:32 -07:00
Sugu Sougoumarane 47cbd4a116 Merge pull request #2822 from tirsen/binlog-player-source-tablet-flag
Flag for specifying the source tablet type of the binlog player
2017-05-18 19:16:50 -07:00
Jon Tirsen 44f037c51d Handle comments in the prefix (#2862)
* Handle comments in the prefix

* Handle multiple comments and move to comments.go
2017-05-18 19:15:09 -07:00
Alain Jobart fe65a3125d Fixing all context imports.
Except the go 1.8 database driver, that one needs the go 1.8 context.
2017-05-18 09:56:17 -07:00
Alain Jobart 1bed2e48e8 Merging go/mysql/replication into go/mysql. 2017-05-18 09:25:15 -07:00
Alain Jobart e931f5a158 De-dupping a few constants. 2017-05-18 08:48:25 -07:00
Alain Jobart 5057fb0658 Moving go/sqldb to go/mysql.
Last type was SQLError.
2017-05-18 08:35:48 -07:00
Alain Jobart 6fcf5eec08 Moving ConnParams to go/mysql.
And moving endtoend tests from go/mysql to go/mysql/endtoend.
This breaks the go/vt/vttest circular dependency, and makes the
tests that need a MySQL instance all in the same place, cleaner.
2017-05-18 08:09:31 -07:00
Alain Jobart 828939550b Removing the sqldb.Conn interface.
Now using *mysql.Conn everywhere.
2017-05-17 16:54:23 -07:00
Alain Jobart 5bf6248b73 Moving utility method from sqldb to mysql. 2017-05-17 16:01:23 -07:00
Alain Jobart 0c95e5eab1 Renaming go/mysqlconn to go/mysql. 2017-05-17 15:17:40 -07:00
Alain Jobart 27049b3bf1 Removing deprecated go/mysql package. 2017-05-17 13:58:33 -07:00
Bryan Beaudreault 5dbcd4d29c Parser support for multi-table updates (#2852)
* Add parser support for multi-table updates. Add unsupported errors to ensure they don't go through the builder yet

* fix compile issues

* Add parser support for multi-table deletes. Add unsupported errors to ensure they don't go through the builder yet

* Add tests for PASS_DML

* use processTableExprs to support pass through on unsharded and simple equal unique sharded cases

* only process table exprs if there's more than 1, otherwise preserve old logic

* clarify error

* Add keyspace to plan, catch more types of routable queries, update tests

* use bldr for both cases
2017-05-16 15:27:45 -07:00
Alain Jobart 32e07c2e4d Merge pull request #2517 from alainjobart/mysqlconn2
Make mysqlconn the default implementation.
2017-05-16 10:52:56 -07:00
Alain Jobart a6e5e27431 Reverting test to pre-fix version.
StrayTransactions is actually 0 if no other test leaks them.
2017-05-16 10:29:11 -07:00
Alain Jobart 1304bfd283 Removing unused method. 2017-05-16 09:36:46 -07:00
Alain Jobart e5068fe78c Fixing stray go routine in test. 2017-05-16 09:01:43 -07:00
Alain Jobart 66c3bd1cf6 Adding a Closed flag to mysqlconn.Conn.
That way two things can happen:
- ConnectionID is always valid, even if Close() has been called. Useful
to remove Connection objects from maps for instance, after closed.
- IsClosed() can use the flag, and be accurate. Before that, calling
IsClosed() after Close() would return false.
2017-05-16 09:01:43 -07:00
Alain Jobart ee5a98207d Propagate Query in mysqlconn errors. 2017-05-15 14:43:53 -07:00
Sugu Sougoumarane a7d4090de5 Merge pull request #2859 from sougou/mysqld
fix for #2821
2017-05-15 10:31:09 -07:00
Sugu Sougoumarane a63a0b95d6 Merge pull request #2857 from sougou/bugs
fix for #2818
2017-05-15 10:30:54 -07:00
Alain Jobart fb628e54db Switching to new mysqlconn by default for all.
This is just to make sure all tests pass.
This is based on the other branch.
2017-05-15 10:22:32 -07:00
Sugu Sougoumarane aca760f37c v3: last_insert_id for unsharded keyspaces
last_insert_id was disallowed for all keyspaces because it
conflicted with Vitess sequences. Now, on special request,
we'll allow it for only unsharded keyspaces with the caveat that
it's a simple pass-through.
2017-05-15 02:12:49 -07:00
Sugu Sougoumarane 34ff49a3cd v3: information_schema queries 2017-05-15 01:00:49 -07:00
Sugu Sougoumarane 95f15f3300 v3: prep for information_schema support
* parseTaget->executor.ParseTarget. If the vschema has only
  one keyspace, the target is set to that. This should cover
  a few more use cases.
* Find: improved signature.
* newRoute does not set the table for the symtab because there
  are flows where there is no table (union). The setting is
  done only where it's required.
* AddAlias->InitWithAlias: it's a more appropriate name. The
  function also panics if the symtab already contains symbols.
2017-05-15 01:00:49 -07:00
Sugu Sougoumarane 9050fadcb8 v3: consolidate Opcode checks into route
As we add more opcodes, it's getting harder to chase down
all places that reference it. This change moves all those
checks into route. It should make it easier to add new ones.
2017-05-15 01:00:49 -07:00
Sugu Sougoumarane 9c7670230d fix for #2821
Some installs of mysql don't have mysqld_safe. Update mysqlctl
to directly launch mysqld if mysqld_safe cannot be found.

I've tested this manually by renaming mysqld_safe.
2017-05-14 18:01:15 -07:00
Sugu Sougoumarane 30524932ae v3: symtab: improved auto-resolve
Auto-resolve has been improved as follows:
* If a vindex column is unique across all tables, then you
  are allowed to reference it without a qualifier.
* If all tables in the symtab are in the same route, there
  is no need to use a qualifer. The column reference will
  be anonymously assigned to that route.

On the implementation side, the autoResolve flag is not
passed in any more. Instead, it becomes an internal property of
symtab.

Symtab also acquires a new member 'globals' which are used
to resolve unqualified references. We also add oneRoute, which
is set if all tables belong to a single route.
2017-05-14 16:33:04 -07:00
Sugu Sougoumarane 404e937f36 parser: NonStarExpr->AliasedExpr
The name had become misleading after the introduction
of NextVal. It was also aesthetically unpleasing.
2017-05-14 16:33:04 -07:00
Sugu Sougoumarane 32cd70c908 fix for #2818
@tirsen
I still need to figure out how to test this. But existing tests
are passing for now. Can you let me know if this fixes your problem?
2017-05-14 15:51:35 -07:00
Sugu Sougoumarane 9dbb13eced v3: Order->MaxOrder, and improved comments
Order was incorrectly named. Its true meaning was MaxOrder.
Join nodes do not have an Order because they are not traversal
destinations. Only a route has an order, and it now has a
member called Order to indicate that.

This design presumes that only route nodes can have order.
In the future, newer nodes may also become valid traversal
destinations. If this happens, the APIs will be adjusted
accordingly.

I've merged the comments in doc.go and builder.go into
the description of MaxOrder.
2017-05-13 00:04:52 -07:00
Sugu Sougoumarane 5bf121bd5c v3: symtab refactor
This is prep work for being able to allow more constructs to
be recognized as pass-through, especially for unsharded keyspaces.

The fundamental intent behind this change is to allow for a symbol
to be associated to just a route without knowing which table it's
coming from. So, if you have a query like 'select a from t1, t2'
where t1 and t2 are from the same keyspace, then we can still
push-down 'a' into that route without knowing which table it comes
from.

Additionally, the concept of colRef was confusing because it had
different interpretations depending on whether it was a select
column or table column. Colsym was another confusing name because
it wasn't really a column symbol.

The new scheme is actually easier to understand if studied fresh:
symtab contains tables, and tables contain columns.
A table column pointer uniquely identifies the column.
symtab also contains result columns. A result column contains a
column reference. If it's a real column, then it points to the
actual table column. Otherwise, it's a unique anonymous reference
that just points to the originating route.

This column reference is saved as Metadata in ColName elements
where they previously used to store colRef. This results in
some simplification. More importantly, a 'column' can now be
anonymous, which should let us support more constructs.
2017-05-13 00:04:52 -07:00
Bryan Beaudreault 35ace3a0f4 Decouple CONVERT(..USING..) from CONVERT() (#2851)
* convert(... using ...) works differently than convert() without using, so should not be rewritten as such

* Make a new ast node for convert using
2017-05-12 12:56:13 -07:00
Alain Jobart abf2341303 Fixing a couple proto compare.
BUG=37574309
2017-05-10 07:02:01 -07:00
Jon Tirsen 98a72709af Flag for specifying the source tablet type of the binlog player 2017-05-09 11:06:06 +02:00
Michael Berlin 0770876547 vtgate: Fix gofmt error. 2017-05-08 22:14:50 -07:00