We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scenario:
$ cd examples/local/ $ for i in `ls -1 *.sh | grep ^[1-3]` ; do echo $i ; ./$i ; sleep 5 ; done
Now, have the following vschema and schema:
vschema.json:
{ "sharded": true, "vindexes": { "hash": { "type": "hash" }, "lookup1": { "type": "consistent_lookup", "params": { "table": "lookup1", "from": "field", "to": "keyspace_id", "ignore_nulls": "true" }, "owner": "t1" }, "lookup2": { "type": "consistent_lookup", "params": { "table": "lookup2", "from": "field2", "to": "keyspace_id", "ignore_nulls": "true" }, "owner": "t1" } }, "tables": { "t1": { "column_vindexes": [ { "column": "id", "name": "hash" }, { "column": "field", "name": "lookup1" }, { "column": "field2", "name": "lookup2" } ] }, "lookup1": { "column_vindexes": [ { "column": "field", "name": "hash" } ] }, "lookup2": { "column_vindexes": [ { "column": "field2", "name": "hash" } ] } } }
schema.sql:
CREATE TABLE t1 ( id BIGINT NOT NULL, field BIGINT NOT NULL, field2 BIGINT, PRIMARY KEY (id) ) ENGINE=Innodb; CREATE TABLE lookup1 ( field BIGINT NOT NULL, keyspace_id binary(8), UNIQUE KEY (field) ) ENGINE=Innodb; CREATE TABLE lookup2 ( field2 BIGINT NOT NULL, keyspace_id binary(8), UNIQUE KEY (field2) ) ENGINE=Innodb;
Apply the sharded vschema and schema on the sharded customer keyspace in the examples:
$ vtctlclient -server localhost:15999 ApplyVSchema -vschema_file=`pwd`/vschema.json customer $ vtctlclient -server localhost:15999 ApplySchema -sql-file=`pwd`/schema.sql customer
Now, connect to vtgate, and run the given multi-value insert:
$ mysql -s -u root -P 15306 -h 127.0.0.1 customer mysql> INSERT INTO t1 (id, field, field2) VALUES (0,1,2), (1,2,3), (2,3,4), (3,4,5), (4,5,6), (5,6,7), (6,7,8), (7,8,9), (8,9,10), (9,10,11), (10,11,12), (11,12,13), (12,13,14), (13,14,15), (14,15,16), (15,16,17), (16,17,18), (17,18,19), (18,19,20), (19,20,21), (20,21,22);
This all works fine, but now inspect the result of the insert:
mysql> select id, field, field2 from t1 order by id; id field field2 0 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7 6 7 8 7 8 9 8 9 10 9 10 11 10 11 12 11 12 13 12 13 14 13 14 15 14 15 16 15 16 17 16 17 18 17 18 19 18 19 20 19 20 21 20 2 22
As can be seen, the value for t1.field for id = 20 is incorrect, it should be 21, not 2.
t1.field
id = 20
21
2
The text was updated successfully, but these errors were encountered:
e65e5e8
Fixes vitessio#6266
ccdd2df
Signed-off-by: Andres Taylor <andres@planetscale.com>
dfb7102
No branches or pull requests
Scenario:
Now, have the following vschema and schema:
vschema.json:
schema.sql:
Apply the sharded vschema and schema on the sharded customer keyspace in the examples:
Now, connect to vtgate, and run the given multi-value insert:
This all works fine, but now inspect the result of the insert:
As can be seen, the value for
t1.field
forid = 20
is incorrect, it should be21
, not2
.The text was updated successfully, but these errors were encountered: