vitess.io/vitess@v0.16.2/go/vt/vtgate/planbuilder/testdata/bypass_shard_cases.json (about) 1 [ 2 { 3 "comment": "select bypass", 4 "query": "select count(*), col from unsharded", 5 "plan": { 6 "QueryType": "SELECT", 7 "Original": "select count(*), col from unsharded", 8 "Instructions": { 9 "OperatorType": "Send", 10 "Keyspace": { 11 "Name": "main", 12 "Sharded": false 13 }, 14 "TargetDestination": "Shard(-80)", 15 "Query": "select count(*), col from unsharded" 16 } 17 } 18 }, 19 { 20 "comment": "update bypass", 21 "query": "update user set val = 1 where id = 18446744073709551616 and id = 1", 22 "plan": { 23 "QueryType": "UPDATE", 24 "Original": "update user set val = 1 where id = 18446744073709551616 and id = 1", 25 "Instructions": { 26 "OperatorType": "Send", 27 "Keyspace": { 28 "Name": "main", 29 "Sharded": false 30 }, 31 "TargetDestination": "Shard(-80)", 32 "IsDML": true, 33 "Query": "update `user` set val = 1 where id = 18446744073709551616 and id = 1" 34 } 35 } 36 }, 37 { 38 "comment": "delete bypass", 39 "query": "DELETE FROM USER WHERE ID = 42", 40 "plan": { 41 "QueryType": "DELETE", 42 "Original": "DELETE FROM USER WHERE ID = 42", 43 "Instructions": { 44 "OperatorType": "Send", 45 "Keyspace": { 46 "Name": "main", 47 "Sharded": false 48 }, 49 "TargetDestination": "Shard(-80)", 50 "IsDML": true, 51 "Query": "delete from `USER` where ID = 42" 52 } 53 } 54 }, 55 { 56 "comment": "insert bypass", 57 "query": "INSERT INTO USER (ID, NAME) VALUES (42, 'ms X')", 58 "plan": { 59 "QueryType": "INSERT", 60 "Original": "INSERT INTO USER (ID, NAME) VALUES (42, 'ms X')", 61 "Instructions": { 62 "OperatorType": "Send", 63 "Keyspace": { 64 "Name": "main", 65 "Sharded": false 66 }, 67 "TargetDestination": "Shard(-80)", 68 "IsDML": true, 69 "Query": "insert into `USER`(ID, `NAME`) values (42, 'ms X')" 70 } 71 } 72 }, 73 { 74 "comment": "insert bypass with sequence: sequences ignored", 75 "query": "insert into user(nonid) values (2)", 76 "plan": { 77 "QueryType": "INSERT", 78 "Original": "insert into user(nonid) values (2)", 79 "Instructions": { 80 "OperatorType": "Send", 81 "Keyspace": { 82 "Name": "main", 83 "Sharded": false 84 }, 85 "TargetDestination": "Shard(-80)", 86 "IsDML": true, 87 "Query": "insert into `user`(nonid) values (2)" 88 } 89 } 90 }, 91 { 92 "comment": "bypass query for into outfile s3", 93 "query": "select count(*), col from unsharded into outfile S3 'x.txt'", 94 "plan": { 95 "QueryType": "SELECT", 96 "Original": "select count(*), col from unsharded into outfile S3 'x.txt'", 97 "Instructions": { 98 "OperatorType": "Send", 99 "Keyspace": { 100 "Name": "main", 101 "Sharded": false 102 }, 103 "TargetDestination": "Shard(-80)", 104 "Query": "select count(*), col from unsharded into outfile s3 'x.txt'" 105 } 106 } 107 }, 108 { 109 "comment": "Select outfile", 110 "query": "select * from user into outfile S3 'x.txt'", 111 "plan": { 112 "QueryType": "SELECT", 113 "Original": "select * from user into outfile S3 'x.txt'", 114 "Instructions": { 115 "OperatorType": "Send", 116 "Keyspace": { 117 "Name": "main", 118 "Sharded": false 119 }, 120 "TargetDestination": "Shard(-80)", 121 "Query": "select * from `user` into outfile s3 'x.txt'" 122 } 123 } 124 }, 125 { 126 "query": "load data from s3 'x.txt' into table x", 127 "plan": { 128 "QueryType": "OTHER", 129 "Original": "load data from s3 'x.txt' into table x", 130 "Instructions": { 131 "OperatorType": "Send", 132 "Keyspace": { 133 "Name": "main", 134 "Sharded": false 135 }, 136 "TargetDestination": "Shard(-80)", 137 "IsDML": true, 138 "Query": "load data from s3 'x.txt' into table x", 139 "SingleShardOnly": true 140 } 141 } 142 }, 143 { 144 "query": "load data from s3 'x.txt'", 145 "plan": { 146 "QueryType": "OTHER", 147 "Original": "load data from s3 'x.txt'", 148 "Instructions": { 149 "OperatorType": "Send", 150 "Keyspace": { 151 "Name": "main", 152 "Sharded": false 153 }, 154 "TargetDestination": "Shard(-80)", 155 "IsDML": true, 156 "Query": "load data from s3 'x.txt'", 157 "SingleShardOnly": true 158 } 159 } 160 }, 161 { 162 "comment": "create table", 163 "query": "create /* test */ table t1(id bigint, primary key(id)) /* comments */", 164 "plan": { 165 "QueryType": "DDL", 166 "Original": "create /* test */ table t1(id bigint, primary key(id)) /* comments */", 167 "Instructions": { 168 "OperatorType": "Send", 169 "Keyspace": { 170 "Name": "main", 171 "Sharded": false 172 }, 173 "TargetDestination": "Shard(-80)", 174 "Query": "create /* test */ table t1(id bigint, primary key(id)) /* comments */" 175 } 176 } 177 } 178 ]