зеркало из https://github.com/github/vitess-gh.git
a822e5d7f3
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. |
||
---|---|---|
.. | ||
proto | ||
mysql.go | ||
vtmysql.c | ||
vtmysql.h | ||
vtmysql_internals.h |