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.
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.
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.
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.
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.
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.