| 1 |
CREATE SCHEMA xtest; |
| 2 |
|
| 3 |
Data model: TABLE |
| 4 |
================= |
| 5 |
|
| 6 |
0 rows affected |
| 7 |
|
| 8 |
Insert two docs |
| 9 |
--------------- |
| 10 |
|
| 11 |
2 rows affected |
| 12 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 13 |
Got expected error (code 0) |
| 14 |
doc |
| 15 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 16 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 17 |
0 rows affected |
| 18 |
|
| 19 |
Upsert one doc |
| 20 |
-------------- |
| 21 |
Got expected error: Unable update on duplicate key for TABLE data model (code 5014) |
| 22 |
|
| 23 |
Data model: DOCUMENT |
| 24 |
==================== |
| 25 |
|
| 26 |
Test0 - No matches |
| 27 |
------------------ |
| 28 |
|
| 29 |
command ok |
| 30 |
|
| 31 |
command ok |
| 32 |
|
| 33 |
2 rows affected |
| 34 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 35 |
Got expected error (code 0) |
| 36 |
doc |
| 37 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 38 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 39 |
0 rows affected |
| 40 |
|
| 41 |
1 rows affected |
| 42 |
Got expected error (code 0) |
| 43 |
doc |
| 44 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 45 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 46 |
{"_id": "3", "name": "foo", "email": "[email protected]"} |
| 47 |
0 rows affected |
| 48 |
|
| 49 |
Test1 - Match on _id |
| 50 |
-------------------- |
| 51 |
|
| 52 |
command ok |
| 53 |
|
| 54 |
command ok |
| 55 |
|
| 56 |
2 rows affected |
| 57 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 58 |
Got expected error (code 0) |
| 59 |
doc |
| 60 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 61 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 62 |
0 rows affected |
| 63 |
|
| 64 |
2 rows affected |
| 65 |
Got expected error (code 0) |
| 66 |
doc |
| 67 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 68 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 69 |
0 rows affected |
| 70 |
|
| 71 |
Test2 - Match on secondary key only |
| 72 |
----------------------------------- |
| 73 |
|
| 74 |
command ok |
| 75 |
|
| 76 |
command ok |
| 77 |
|
| 78 |
2 rows affected |
| 79 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 80 |
Got expected error (code 0) |
| 81 |
doc |
| 82 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 83 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 84 |
0 rows affected |
| 85 |
Got expected error: Document contains a field value that is not unique but required to be (code 5116) |
| 86 |
doc |
| 87 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 88 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 89 |
0 rows affected |
| 90 |
|
| 91 |
Test3 - Match on _id only, missing secondary index |
| 92 |
-------------------------------------------------- |
| 93 |
|
| 94 |
command ok |
| 95 |
|
| 96 |
command ok |
| 97 |
|
| 98 |
2 rows affected |
| 99 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 100 |
Got expected error (code 0) |
| 101 |
doc |
| 102 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 103 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 104 |
0 rows affected |
| 105 |
Got expected error: Document is missing a required field (code 5115) |
| 106 |
doc |
| 107 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 108 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 109 |
0 rows affected |
| 110 |
|
| 111 |
Test4 - Match on _id and secondary, but from different rows |
| 112 |
----------------------------------------------------------- |
| 113 |
|
| 114 |
command ok |
| 115 |
|
| 116 |
command ok |
| 117 |
|
| 118 |
2 rows affected |
| 119 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 120 |
Got expected error (code 0) |
| 121 |
doc |
| 122 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 123 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 124 |
0 rows affected |
| 125 |
Got expected error: Document contains a field value that is not unique but required to be (code 5116) |
| 126 |
doc |
| 127 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 128 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 129 |
0 rows affected |
| 130 |
|
| 131 |
Test5 - Match on _id and secondary key (other field value updated) |
| 132 |
------------------------------------------------------------------ |
| 133 |
|
| 134 |
command ok |
| 135 |
|
| 136 |
command ok |
| 137 |
|
| 138 |
2 rows affected |
| 139 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 140 |
Got expected error (code 0) |
| 141 |
doc |
| 142 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 143 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 144 |
0 rows affected |
| 145 |
|
| 146 |
2 rows affected |
| 147 |
Got expected error (code 0) |
| 148 |
doc |
| 149 |
{"_id": "1", "name": "bla", "email": "[email protected]"} |
| 150 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 151 |
0 rows affected |
| 152 |
|
| 153 |
Test7 - New unique document, with missing field on secondary key |
| 154 |
---------------------------------------------------------------- |
| 155 |
|
| 156 |
command ok |
| 157 |
|
| 158 |
command ok |
| 159 |
|
| 160 |
2 rows affected |
| 161 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 162 |
Got expected error (code 0) |
| 163 |
doc |
| 164 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 165 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 166 |
0 rows affected |
| 167 |
Got expected error: Document is missing a required field (code 5115) |
| 168 |
doc |
| 169 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 170 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 171 |
0 rows affected |
| 172 |
|
| 173 |
Test8 - Match on _id only, missing field at secondary index |
| 174 |
------------------------------------------------------------ |
| 175 |
|
| 176 |
command ok |
| 177 |
|
| 178 |
command ok |
| 179 |
|
| 180 |
2 rows affected |
| 181 |
Records: 2 Duplicates: 0 Warnings: 0 |
| 182 |
Got expected error (code 0) |
| 183 |
doc |
| 184 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 185 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 186 |
0 rows affected |
| 187 |
Got expected error: Document is missing a required field (code 5115) |
| 188 |
doc |
| 189 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 190 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 191 |
0 rows affected |
| 192 |
|
| 193 |
Test9 - Match on _id and null value at secondary index |
| 194 |
------------------------------------------------------ |
| 195 |
|
| 196 |
command ok |
| 197 |
|
| 198 |
command ok |
| 199 |
|
| 200 |
1 rows affected |
| 201 |
Got expected error (code 0) |
| 202 |
|
| 203 |
1 rows affected |
| 204 |
Got expected error (code 0) |
| 205 |
|
| 206 |
1 rows affected |
| 207 |
Got expected error (code 0) |
| 208 |
doc |
| 209 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 210 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 211 |
{"_id": "3", "name": "foo", "email": "[email protected]"} |
| 212 |
0 rows affected |
| 213 |
Got expected error: Document contains a field value that is not unique but required to be (code 5116) |
| 214 |
doc |
| 215 |
{"_id": "1", "name": "foo", "email": "[email protected]"} |
| 216 |
{"_id": "2", "name": "bla", "email": "[email protected]"} |
| 217 |
{"_id": "3", "name": "foo", "email": "[email protected]"} |
| 218 |
0 rows affected |
| 219 |
Mysqlx.Ok { |
| 220 |
msg: "bye!" |
| 221 |
} |
| 222 |
ok |