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

950 Коммитов

Автор SHA1 Сообщение Дата
sougou 2341bd4101 Merge pull request #1346 from youtube/suguwork
sqlparser: change JOIN syntax to match MySQL
2015-11-25 10:45:20 -08:00
Anthony Yeh 0dd6311ef6 sqlparser: Avoid unnecessary buffer pre-allocation.
bytes.Buffer has its own 64-byte bootstrap area, so there's no reason to
pre-allocate a buffer less than that.

Before:

```
BenchmarkParse1-12         20000             82960 ns/op          119243
B/op        101 allocs/op
BenchmarkParse2-12         10000            111208 ns/op          126882
B/op        315 allocs/op
```

After:

```
BenchmarkParse1-12         20000             71989 ns/op          119035
B/op         88 allocs/op
BenchmarkParse2-12         10000            111424 ns/op          126225
B/op        274 allocs/op
```
2015-11-23 18:47:18 -08:00
Sugu Sougoumarane 09d5960edb sqlpraser: allow multiple tables when parenthesized
This something that MySQL allows.
2015-11-23 00:21:28 -08:00
Sugu Sougoumarane 7ae31aa871 protos: rest of the protos renamed to ...pb 2015-11-19 22:03:19 -08:00
Alain Jobart 3874c68ee9 Switching tabletconn API out of tproto.QueyrResultList. 2015-11-19 16:22:40 -08:00
Alain Jobart 236e754965 Removing a few obsolete BSON structures. 2015-11-19 08:36:01 -08:00
Alain Jobart 527c9fe5b3 One change needed for import. 2015-11-18 20:18:03 -08:00
Sugu Sougoumarane 007fa05534 sqltypes.Value: few more fixes
Created to different Proto3ToResult functions, one for the
normal case, and the other for streaming.
Also changed vtcombo to use the new Result.Copy method. Those
proto3 conversion functions are now too loaded with semantics.
So, they can't be used in this situation.
2015-11-17 15:15:10 -08:00
Sugu Sougoumarane a822e5d7f3 sqltypes: new Value
The new Value implementation is now based on the vitess types.
* The inner interface has now been replaced by typ and val.
* All Values are expected to be consistent with their types.
  For example, an Int64 type must contain a number.
* The functions that build values generally ensure consistency.
* There is a set of 'Trusted' functions that can bypass this
  consistency check. They should be used with care.
* The proto3 conversion functions build the correct Value types
  based on the field types.
* The bson conversion function provides a Repair function that
  allows you to fix up the types after the fact. This should be
  deleted after bson is deprecated.
* The building of Values from a QueryResult is non-trivial because
  the field info is not part of the QueryResult for streaming
  queries. So, the API requires fields to be explicitly passed in.
* Fuctions that encode or convert to native types expect Value
  to be consistent. If not, they panic.
* proto3.QueryResult is considered to be trusted. If it contains
  inconsistent data, it will cause panics.
* The EventStreamer has been fixed to ensure that the fields and
  rows it publishes are trustable: They can used as parameters
  to the Trusted API.
* The Raw() function usage has been minimized. We should see if
  it can be deprecated. This way, we can make Result truly read-only.

There are a few more tweaks that need to be done:
* The Proto3ToResult call plumbing was hacked in to make everything
  work. That part needs cleaning.
* The bind vars don't need to be converted to their native types
  any more.
2015-11-17 12:59:45 -08:00
Anthony Yeh c7d320e0e5 Merge pull request #1316 from enisoc/history
tabletserver: Add state history to status page.
2015-11-13 10:41:52 -08:00
Anthony Yeh 6ce3d7cedc tabletserver: Add state history to status page. 2015-11-13 01:07:16 -08:00
Sugu Sougoumarane bc7e2da01d tabletserver: rename NOT_SERVING types correctly 2015-11-12 21:20:22 -08:00
Sugu Sougoumarane 0f679e6bd6 tabletserver: secondary serving types
Added support for secondary serving types for tabletserver.
I went with an additional parameter called alsoAllow instead
of changing the original one to a slice. This makes the API more
clear because the first tabletType is a mandatory parameter and
the primary serving type. So, it has special meaning, whereas
alsoAllow will predominantly be nil.
2015-11-12 21:08:03 -08:00
Sugu Sougoumarane 4b28cb932f tabletserver: add lameduck support
lameduck is a new flag that causes tabletserver to report
itself as unhealthy. The behavior is otherwise unchanged.
I've made it such that any call to SetServingType causes
this to be reset. This should make the common use cases
more straightforward to implement.
2015-11-12 16:43:52 -08:00
Sugu Sougoumarane 089e2bad40 more protos renamed
what's left: vtctldata vtctlservice vtgate vtgateservice vtrpc
vtworkerdata vtworkerservice
2015-11-12 01:13:51 -08:00
Sugu Sougoumarane 274cf0c29d proto/query -> querypb
I was bored.
2015-11-12 00:13:54 -08:00
Alain Jobart d711e36056 Renaming a few *Replication* structures without the Replication. 2015-11-11 14:28:50 -08:00
Alain Jobart a02cbd71a9 Moving replication structures out of mysqlctl/proto, which is then gone. 2015-11-11 12:21:13 -08:00
Alain Jobart 11b9990b32 Removing unnecessary govet exception, and fixing paths
in the exception file to prove it works.
2015-11-11 09:57:45 -08:00
Sugu Sougoumarane 71469f54c5 sqltypes: all code changed to use Result 2015-11-10 00:50:46 -08:00
Alain Jobart 7353041414 Merge pull request #1300 from alainjobart/resharding
RIP gorpc tablet conn. We have a working gRPC version.
2015-11-09 15:26:13 -08:00
Sugu Sougoumarane 3d85ca461a Merge branch 'master' into suguwork 2015-11-09 14:17:24 -08:00
Alain Jobart ce96bc6611 RIP gorpc tablet conn. We have a working gRPC version. 2015-11-09 14:14:31 -08:00
Alain Jobart b940f5278f Removing native StreamEvent, replacing it with proto3 version. 2015-11-09 09:23:29 -08:00
Sugu Sougoumarane 03dd9b6f32 []mproto.Field -> []*query.Field
This part 1 of the QueryResult revamp. With this change,
vitess does not see any MySQL types. The BSON layer still
sends mysql types for backward compatibility, which will
be deleted once deprecated.
2015-11-09 01:52:07 -08:00
sougou 9ca1cc26e9 Merge pull request #1292 from youtube/suguwork
QueryResult transition: WIP
2015-11-06 09:35:44 -08:00
Sugu Sougoumarane ce67d707be sqltypes transition: MySQLToType panic on error 2015-11-05 23:37:27 -08:00
Sugu Sougoumarane ccbe5915c5 sqltypes transition: Inner->inner 2015-11-05 21:19:23 -08:00
Sugu Sougoumarane be45074302 schema: use vitess type system 2015-11-05 21:03:18 -08:00
Sugu Sougoumarane 90c5c2d5ad Merge branch 'master' into suguwork 2015-11-05 11:02:30 -08:00
Alain Jobart 0b5fd96944 Removing a few more usages of the non-proto3 KeyRange. 2015-11-05 08:53:43 -08:00
Jeff (Zhefu) Jiang bb0f039f98 Remove debug loggings 2015-11-04 02:28:37 -08:00
Jeff (Zhefu) Jiang 3c9ab22860 Stop TableACL from panicing VTTablet 2015-11-04 02:20:20 -08:00
Jeff (Zhefu) Jiang 44380f59f1 Fix perf counter 2015-11-03 18:58:30 -08:00
Jeff (Zhefu) Jiang 990c15841d Fix TableACL SuperUser feature by enforcing group authorization 2015-11-03 18:50:00 -08:00
Sugu Sougoumarane e8aa83fcdc query.proto: bind var conversion tweak 2015-11-02 21:17:46 -08:00
Sugu Sougoumarane 4427a5f152 tabletserver: support for /debug/query_rules 2015-11-01 10:46:58 -08:00
Sugu Sougoumarane 325a3c81ec tabletserver: query_rules improvements
Simplified the query rules specs:
* Bind var comparison operators are not typed any more.
* You can now give actual numbers for bind var condition operands.
* Bind var condition operators are intuitive, like "==", etc.
* MarshalJSON support.
2015-11-01 01:17:58 -08:00
Sugu Sougoumarane a049849965 proto: add NULL test case for conn tests 2015-10-25 22:09:46 -07:00
Sugu Sougoumarane d12476e9fe proto: migrate EntityIds 2015-10-25 22:02:58 -07:00
Sugu Sougoumarane 1e20603a06 proto: bindvar, fields and rows tests 2015-10-25 21:06:29 -07:00
Sugu Sougoumarane e245e12185 proto: tests for bindvar conversions 2015-10-25 18:56:08 -07:00
Sugu Sougoumarane 86780e0fcc proto: wrapper functions for flags 2015-10-24 18:58:20 -07:00
Sugu Sougoumarane 5aa0b5c830 proto: add error handling 2015-10-24 18:10:03 -07:00
Sugu Sougoumarane 94eb00ff00 proto: misc renames
Float -> Float32
Double -> Float64
IsNumber -> IsIntegral

Also addressed some code review comments.
2015-10-24 00:08:53 -07:00
Sugu Sougoumarane c5691e1cbc proto: revamp bind vars
I've done enough to get the existing unit tests to pass, but I
think they're insufficient. There also a few TODOs sprayed around.
2015-10-23 22:30:35 -07:00
Sugu Sougoumarane 6ed05d1d28 proto: int type names changed
Tiny, Long, etc. are not very understandable. I've now changed the
types to intXX, which is more intuitive.
2015-10-23 13:46:47 -07:00
Sugu Sougoumarane c7918063a3 New rows proto change
So far, unit tests are passing. Still need to look at clients.
2015-10-23 02:07:03 -07:00
Sugu Sougoumarane 175fcf2acc New vitess-specific types
This change defines the new types, how they are derived from
MySQL, and tests to make sure the conversions work.
2015-10-22 22:17:35 -07:00
Dominic Hamon 47944cbbfd Handle nil type in proto3 bound variables 2015-10-22 13:10:04 -07:00