|
| 1 | +# |
| 2 | +# MDEV-24093: Detect during mysql_upgrade if type_mysql_json.so |
| 3 | +# is needed and load it |
| 4 | +# |
| 5 | +SET NAMES utf8; |
| 6 | +show create table mysql_json_test; |
| 7 | +ERROR HY000: Unknown data type: 'MYSQL_JSON' |
| 8 | +Phase 1/7: Checking and upgrading mysql database |
| 9 | +Processing databases |
| 10 | +mysql |
| 11 | +mysql.column_stats OK |
| 12 | +mysql.columns_priv OK |
| 13 | +mysql.db OK |
| 14 | +mysql.event OK |
| 15 | +mysql.func OK |
| 16 | +mysql.global_priv OK |
| 17 | +mysql.gtid_slave_pos OK |
| 18 | +mysql.help_category OK |
| 19 | +mysql.help_keyword OK |
| 20 | +mysql.help_relation OK |
| 21 | +mysql.help_topic OK |
| 22 | +mysql.index_stats OK |
| 23 | +mysql.innodb_index_stats |
| 24 | +Error : Unknown storage engine 'InnoDB' |
| 25 | +error : Corrupt |
| 26 | +mysql.innodb_table_stats |
| 27 | +Error : Unknown storage engine 'InnoDB' |
| 28 | +error : Corrupt |
| 29 | +mysql.plugin OK |
| 30 | +mysql.proc OK |
| 31 | +mysql.procs_priv OK |
| 32 | +mysql.proxies_priv OK |
| 33 | +mysql.roles_mapping OK |
| 34 | +mysql.servers OK |
| 35 | +mysql.table_stats OK |
| 36 | +mysql.tables_priv OK |
| 37 | +mysql.time_zone OK |
| 38 | +mysql.time_zone_leap_second OK |
| 39 | +mysql.time_zone_name OK |
| 40 | +mysql.time_zone_transition OK |
| 41 | +mysql.time_zone_transition_type OK |
| 42 | +mysql.transaction_registry |
| 43 | +Error : Unknown storage engine 'InnoDB' |
| 44 | +error : Corrupt |
| 45 | + |
| 46 | +Repairing tables |
| 47 | +mysql.innodb_index_stats |
| 48 | +Error : Unknown storage engine 'InnoDB' |
| 49 | +error : Corrupt |
| 50 | +mysql.innodb_table_stats |
| 51 | +Error : Unknown storage engine 'InnoDB' |
| 52 | +error : Corrupt |
| 53 | +mysql.transaction_registry |
| 54 | +Error : Unknown storage engine 'InnoDB' |
| 55 | +error : Corrupt |
| 56 | +Phase 2/7: Installing used storage engines... Skipped |
| 57 | +installing plugin for MYSQL_JSON data type |
| 58 | +Phase 3/7: Fixing views |
| 59 | +mysql.user OK |
| 60 | +Phase 4/7: Running 'mysql_fix_privilege_tables' |
| 61 | +Phase 5/7: Fixing table and database names |
| 62 | +Phase 6/7: Checking and upgrading tables |
| 63 | +Processing databases |
| 64 | +information_schema |
| 65 | +mtr |
| 66 | +mtr.global_suppressions OK |
| 67 | +mtr.test_suppressions OK |
| 68 | +performance_schema |
| 69 | +test |
| 70 | +test.mysql_json_test Needs upgrade |
| 71 | +test.mysql_json_test_big Needs upgrade |
| 72 | + |
| 73 | +Repairing tables |
| 74 | +test.mysql_json_test OK |
| 75 | +test.mysql_json_test_big OK |
| 76 | +uninstalling plugin for 'type_mysql_json' data type |
| 77 | +Phase 7/7: Running 'FLUSH PRIVILEGES' |
| 78 | +OK |
| 79 | +show create table mysql_json_test; |
| 80 | +Table Create Table |
| 81 | +mysql_json_test CREATE TABLE `mysql_json_test` ( |
| 82 | + `description` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, |
| 83 | + `expected` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, |
| 84 | + `actual` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL |
| 85 | +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
| 86 | +select * from mysql_json_test; |
| 87 | +description expected actual |
| 88 | +Raw integers as JSON 0 0 |
| 89 | +Raw integers as JSON -127 -127 |
| 90 | +Raw integers as JSON 128 128 |
| 91 | +Raw integers as JSON 32767 32767 |
| 92 | +Raw integers as JSON -32768 -32768 |
| 93 | +Raw integers as JSON 65535 65535 |
| 94 | +Raw integers as JSON 65536 65536 |
| 95 | +Raw integers as JSON -2147483648 -2147483648 |
| 96 | +Raw integers as JSON 2147483647 2147483647 |
| 97 | +Raw integers as JSON 4294967295 4294967295 |
| 98 | +Raw integers as JSON -9223372036854775807 -9223372036854775807 |
| 99 | +Raw integers as JSON 9223372036854775807 9223372036854775807 |
| 100 | +Raw integers as JSON 18446744073709551615 18446744073709551615 |
| 101 | +Raw doubles as JSON 3.14 3.14 |
| 102 | +Raw doubles as JSON -5678.987 -5678.987 |
| 103 | +Raw doubles as JSON -2.2250738585072014e-308 -2.2250738585072014e-308 |
| 104 | +Raw doubles as JSON 2.2250738585072014e-308 2.2250738585072014e-308 |
| 105 | +Simple JSON test {"key1": "val1", "key2": "val2"} {"key1": "val1", "key2": "val2"} |
| 106 | +Raw doubles as JSON 0.0 0.0 |
| 107 | +Simple Array as Value {"a": [1, 2], "b": ["x", "y"]} {"a": [1, 2], "b": ["x", "y"]} |
| 108 | +Simple Array as Base Key [1, 2, 3, 4, 5, [], "a", "b", "c"] [1, 2, 3, 4, 5, [], "a", "b", "c"] |
| 109 | +GeoJSON {"type": "MultiPoint", "coordinates": [[1, 1], [2, 2], [3, 3]]} {"type": "MultiPoint", "coordinates": [[1, 1], [2, 2], [3, 3]]} |
| 110 | +GeoJSON {"type": "LineString", "coordinates": [[0, 5], [5, 10], [10, 15]]} {"type": "LineString", "coordinates": [[0, 5], [5, 10], [10, 15]]} |
| 111 | +GeoJSON {"type": "GeometryCollection", "geometries": []} {"type": "GeometryCollection", "geometries": []} |
| 112 | +GeoJSON {"type": "Point", "coordinates": [11.1111, 12.22222]} {"type": "Point", "coordinates": [11.1111, 12.22222]} |
| 113 | +Opaque Types: opaque_mysql_type_set "b,c" "b,c" |
| 114 | +Opaque Types: opaque_mysql_type_enum "b" "b" |
| 115 | +Opaque Types: opaque_mysql_type_date "2015-01-15" "2015-01-15" |
| 116 | +Opaque Types: opaque_mysql_type_time "23:24:25.000000" "23:24:25.000000" |
| 117 | +Opaque Types: opaque_mysql_type_datetime "2015-01-15 23:24:25.000000" "2015-01-15 23:24:25.000000" |
| 118 | +Opaque Types: opaque_mysql_type_geom {"type": "Point", "coordinates": [1, 1]} {"type": "Point", "coordinates": [1, 1]} |
| 119 | +Opaque Types: opaque_mysql_type_bit "base64:type16:yv4=" "base64:type16:yv4=" |
| 120 | +Opaque Types: opaque_mysql_type_year "base64:type13:MjAxOQ==" "base64:type13:MjAxOQ==" |
| 121 | +Opaque Types: opaque_mysql_type_blob "base64:type252:yv66vg==" "base64:type252:yv66vg==" |
| 122 | +Opaque Types: opaque_mysql_type_longblob "base64:type251:yv66vg==" "base64:type251:yv66vg==" |
| 123 | +Opaque Types: opaque_mysql_type_mediumblob "base64:type250:yv66vg==" "base64:type250:yv66vg==" |
| 124 | +Opaque Types: opaque_mysql_type_tinyblob "base64:type249:yv66vg==" "base64:type249:yv66vg==" |
| 125 | +Opaque Types: opaque_mysql_type_varchar "base64:type15:Zm9v" "base64:type15:Zm9v" |
| 126 | +DateTime as Raw Value: "2015-01-15 23:24:25.000000" "2015-01-15 23:24:25.000000" |
| 127 | +Opaque Types: opaque_mysql_type_varbinary "base64:type15:YWJj" "base64:type15:YWJj" |
| 128 | +Opaque Types: opaque_mysql_type_binary "base64:type254:YWJjAAAAAAAAAA==" "base64:type254:YWJjAAAAAAAAAA==" |
| 129 | +DateTime as Raw Value: "23:24:25.000000" "23:24:25.000000" |
| 130 | +DateTime as Raw Value: "2015-01-15" "2015-01-15" |
| 131 | +DateTime as Raw Value: "2015-01-15 23:24:25.000000" "2015-01-15 23:24:25.000000" |
| 132 | +UTF8 Characters: {"Person": "EMP", "details": {"Name": "Anel Husaković - test: đžšćč"}} {"Person": "EMP", "details": {"Name": "Anel Husaković - test: đžšćč"}} |
| 133 | +UTF8 Characters: "Anel Husaković - test: đžšćč" "Anel Husaković - test: đžšćč" |
| 134 | +UTF8 Characters: {"Name": "Anel Husaković - test: đžšćč"} {"Name": "Anel Husaković - test: đžšćč"} |
| 135 | +UTF8 Characters: {"details": {"Name": "Anel Husaković - test: đžšćč"}, "\"Anel Husaković - test: đžšćč\"": "EMP"} {"details": {"Name": "Anel Husaković - test: đžšćč"}, "\"Anel Husaković - test: đžšćč\"": "EMP"} |
| 136 | +Special Characters: {"{": "}"} {"{": "}"} |
| 137 | +Special Characters: "key1 - with \" val " "key1 - with \" val " |
| 138 | +Special Characters: {"key1 and \n\"key2\"": "val1\t val2"} {"key1 and \n\"key2\"": "val1\t val2"} |
| 139 | +Special Characters: "'" "'" |
| 140 | +Special Characters: "q" "q" |
| 141 | +Special Characters: {"[": "]"} {"[": "]"} |
| 142 | +Special Characters: {"{": "}"} {"{": "}"} |
| 143 | +Empty JSON Object/Array: [] [] |
| 144 | +Special Characters: "some_string" "some_string" |
| 145 | +Special Characters: "'" "'" |
| 146 | +Special Characters: "\"" "\"" |
| 147 | +Special Characters: "" "" |
| 148 | +Special Characters: "'" "'" |
| 149 | +Special Characters: "''" "''" |
| 150 | +Empty JSON Object/Array: {} {} |
| 151 | +Special Characters: "f" "f" |
| 152 | +Special Characters: "\\" "\\" |
| 153 | +Special Characters: "\n" "\n" |
| 154 | +Special Characters: "\f" "\f" |
| 155 | +Special Characters: "\t" "\t" |
| 156 | +Special Characters: "\r" "\r" |
| 157 | +Special Characters: "\b" "\b" |
| 158 | +Special Characters: "\\b" "\\b" |
| 159 | +Special Characters: {"key \n key": "val \n val"} {"key \n key": "val \n val"} |
| 160 | +Special Characters: {"key \f key": "val \f val"} {"key \f key": "val \f val"} |
| 161 | +Special Characters: {"key \t key": "val \t val"} {"key \t key": "val \t val"} |
| 162 | +Special Characters: {"key \r key": "val \r val"} {"key \r key": "val \r val"} |
| 163 | +Special Characters: {"key \b key": "val \b val"} {"key \b key": "val \b val"} |
| 164 | +Special Characters: {"key \\0 key": "val \n val"} {"key \\0 key": "val \n val"} |
| 165 | +Special Characters: {"key \\ key": "val \\ val"} {"key \\ key": "val \\ val"} |
| 166 | +Special Characters: {"key \" key": "val \" val"} {"key \" key": "val \" val"} |
| 167 | +Special Characters: {"key ' key": "val ' val"} {"key ' key": "val ' val"} |
| 168 | +Special Characters: {"key \\Z key": "val ' val"} {"key \\Z key": "val ' val"} |
| 169 | +Special Characters: ["a \f b", "c \f d"] ["a \f b", "c \f d"] |
| 170 | +Special Characters: ["a \t b", "c \t d"] ["a \t b", "c \t d"] |
| 171 | +Special Characters: ["a \r b", "c \r d"] ["a \r b", "c \r d"] |
| 172 | +Special Characters: ["a \b b", "c \b d"] ["a \b b", "c \b d"] |
| 173 | +Special Characters: ["a \\ b", "c \\ d"] ["a \\ b", "c \\ d"] |
| 174 | +Special Characters: ["a \" b", "c \" d"] ["a \" b", "c \" d"] |
| 175 | +Special Characters: ["a ' b", "c ' d"] ["a ' b", "c ' d"] |
| 176 | +Special String Cases: {"": ""} {"": ""} |
| 177 | +Special String Cases: [""] [""] |
| 178 | +Raw LITERALS: true true |
| 179 | +Raw LITERALS: false false |
| 180 | +Raw LITERALS: null null |
| 181 | +JSON LITERALS: {"val": true} {"val": true} |
| 182 | +JSON LITERALS: {"val": false} {"val": false} |
| 183 | +JSON LITERALS: {"val": null} {"val": null} |
| 184 | +Timestamp as RawValue "2019-12-26 19:56:03.000000" "2019-12-26 19:56:03.000000" |
| 185 | +Array LITERALS: ["prefix", null, "suffix", 1] ["prefix", null, "suffix", 1] |
| 186 | +Array LITERALS: ["prefix", false, "suffix", 1] ["prefix", false, "suffix", 1] |
| 187 | +Array LITERALS: ["prefix", true, "suffix", 1] ["prefix", true, "suffix", 1] |
| 188 | +show create table mysql_json_test_big; |
| 189 | +Table Create Table |
| 190 | +mysql_json_test_big CREATE TABLE `mysql_json_test_big` ( |
| 191 | + `description` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, |
| 192 | + `expected` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, |
| 193 | + `actual` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL |
| 194 | +) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
| 195 | +select * from mysql.plugin; |
| 196 | +name dl |
| 197 | +drop table mysql_json_test; |
| 198 | +drop table mysql_json_test_big; |
0 commit comments