vitess.io/vitess@v0.16.2/go/vt/vtgate/planbuilder/testdata/flush_cases_no_default_keyspace.json (about) 1 [ 2 { 3 "comment": "Flush statement", 4 "query": "flush local tables user, unsharded_a, user_extra with read lock", 5 "plan": { 6 "QueryType": "FLUSH", 7 "Original": "flush local tables user, unsharded_a, user_extra with read lock", 8 "Instructions": { 9 "OperatorType": "Concatenate", 10 "Inputs": [ 11 { 12 "OperatorType": "Send", 13 "Keyspace": { 14 "Name": "main", 15 "Sharded": false 16 }, 17 "TargetDestination": "AllShards()", 18 "Query": "flush local tables unsharded_a with read lock" 19 }, 20 { 21 "OperatorType": "Send", 22 "Keyspace": { 23 "Name": "user", 24 "Sharded": true 25 }, 26 "TargetDestination": "AllShards()", 27 "Query": "flush local tables `user`, user_extra with read lock" 28 } 29 ] 30 }, 31 "TablesUsed": [ 32 "main.unsharded_a", 33 "user.user", 34 "user.user_extra" 35 ] 36 } 37 }, 38 { 39 "comment": "Flush statement with flush options", 40 "query": "flush no_write_to_binlog hosts, logs", 41 "plan": "VT03007: keyspace not specified" 42 }, 43 { 44 "comment": "Flush statement with routing rules", 45 "query": "flush local tables route1, route2", 46 "plan": { 47 "QueryType": "FLUSH", 48 "Original": "flush local tables route1, route2", 49 "Instructions": { 50 "OperatorType": "Concatenate", 51 "Inputs": [ 52 { 53 "OperatorType": "Send", 54 "Keyspace": { 55 "Name": "main", 56 "Sharded": false 57 }, 58 "TargetDestination": "AllShards()", 59 "Query": "flush local tables unsharded" 60 }, 61 { 62 "OperatorType": "Send", 63 "Keyspace": { 64 "Name": "user", 65 "Sharded": true 66 }, 67 "TargetDestination": "AllShards()", 68 "Query": "flush local tables `user`" 69 } 70 ] 71 }, 72 "TablesUsed": [ 73 "main.unsharded", 74 "user.user" 75 ] 76 } 77 }, 78 { 79 "comment": "Incorrect tables in flush", 80 "query": "flush tables user.a with read lock", 81 "plan": "table a not found" 82 }, 83 { 84 "comment": "Unknown tables in unsharded keyspaces are allowed", 85 "query": "flush tables main.a with read lock", 86 "plan": { 87 "QueryType": "FLUSH", 88 "Original": "flush tables main.a with read lock", 89 "Instructions": { 90 "OperatorType": "Send", 91 "Keyspace": { 92 "Name": "main", 93 "Sharded": false 94 }, 95 "TargetDestination": "AllShards()", 96 "Query": "flush tables a with read lock" 97 }, 98 "TablesUsed": [ 99 "main.a" 100 ] 101 } 102 }, 103 { 104 "comment": "Flush statement with 3 keyspaces", 105 "query": "flush local tables user, unsharded_a, user_extra, unsharded_tab with read lock", 106 "plan": { 107 "QueryType": "FLUSH", 108 "Original": "flush local tables user, unsharded_a, user_extra, unsharded_tab with read lock", 109 "Instructions": { 110 "OperatorType": "Concatenate", 111 "Inputs": [ 112 { 113 "OperatorType": "Send", 114 "Keyspace": { 115 "Name": "main", 116 "Sharded": false 117 }, 118 "TargetDestination": "AllShards()", 119 "Query": "flush local tables unsharded_a with read lock" 120 }, 121 { 122 "OperatorType": "Send", 123 "Keyspace": { 124 "Name": "main_2", 125 "Sharded": false 126 }, 127 "TargetDestination": "AllShards()", 128 "Query": "flush local tables unsharded_tab with read lock" 129 }, 130 { 131 "OperatorType": "Send", 132 "Keyspace": { 133 "Name": "user", 134 "Sharded": true 135 }, 136 "TargetDestination": "AllShards()", 137 "Query": "flush local tables `user`, user_extra with read lock" 138 } 139 ] 140 }, 141 "TablesUsed": [ 142 "main.unsharded_a", 143 "main_2.unsharded_tab", 144 "user.user", 145 "user.user_extra" 146 ] 147 } 148 } 149 ]