@@ -4263,54 +4263,79 @@ UPDATE mysql.column_stats
4263
4263
SET histogram='["not-what-you-expect"]' WHERE table_name='t1_json';
4264
4264
FLUSH TABLES;
4265
4265
explain select * from t1_json limit 1;
4266
- ERROR HY000: Failed to parse histogram: Root JSON element must be a JSON object at offset 0.
4266
+ id select_type table type possible_keys key key_len ref rows Extra
4267
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4268
+ Warnings:
4269
+ Warning 4186 Failed to parse histogram for table test.t1_json: Root JSON element must be a JSON object at offset 1.
4267
4270
UPDATE mysql.column_stats
4268
4271
SET histogram='{"histogram_hb_v2":"not-histogram"}' WHERE table_name='t1_json';
4269
4272
FLUSH TABLES;
4270
4273
explain select * from t1_json limit 1;
4271
- ERROR HY000: Failed to parse histogram: A JSON array expected at offset 0.
4274
+ id select_type table type possible_keys key key_len ref rows Extra
4275
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4276
+ Warnings:
4277
+ Warning 4186 Failed to parse histogram for table test.t1_json: histogram_hb_v2 must contain an array at offset 35.
4272
4278
UPDATE mysql.column_stats
4273
4279
SET histogram='{"histogram_hb_v2":["not-a-bucket"]}'
4274
4280
WHERE table_name='t1_json';
4275
4281
FLUSH TABLES;
4276
4282
explain select * from t1_json limit 1;
4277
- ERROR HY000: Failed to parse histogram: Object expected at offset 19.
4283
+ id select_type table type possible_keys key key_len ref rows Extra
4284
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4285
+ Warnings:
4286
+ Warning 4186 Failed to parse histogram for table test.t1_json: Expected an object in the buckets array at offset 35.
4278
4287
UPDATE mysql.column_stats
4279
4288
SET histogram='{"histogram_hb_v2":[{"no-expected-members":1}]}'
4280
4289
WHERE table_name='t1_json';
4281
4290
FLUSH TABLES;
4282
4291
explain select * from t1_json limit 1;
4283
- ERROR HY000: Failed to parse histogram: .start member must be present and be a scalar at offset 20.
4292
+ id select_type table type possible_keys key key_len ref rows Extra
4293
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4294
+ Warnings:
4295
+ Warning 4186 Failed to parse histogram for table test.t1_json: "start" element not present at offset 45.
4284
4296
UPDATE mysql.column_stats
4285
4297
SET histogram='{"histogram_hb_v2":[{"start":{}}]}'
4286
4298
WHERE table_name='t1_json';
4287
4299
FLUSH TABLES;
4288
4300
explain select * from t1_json limit 1;
4289
- ERROR HY000: Failed to parse histogram: .start member must be present and be a scalar at offset 20.
4301
+ id select_type table type possible_keys key key_len ref rows Extra
4302
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4303
+ Warnings:
4304
+ Warning 4186 Failed to parse histogram for table test.t1_json: "size" element not present at offset 31.
4290
4305
UPDATE mysql.column_stats
4291
4306
SET histogram='{"histogram_hb_v2":[{"start":"aaa", "size":"not-an-integer"}]}'
4292
4307
WHERE table_name='t1_json';
4293
4308
FLUSH TABLES;
4294
4309
explain select * from t1_json limit 1;
4295
- ERROR HY000: Failed to parse histogram: .size member must be present and be a scalar at offset 20.
4310
+ id select_type table type possible_keys key key_len ref rows Extra
4311
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4312
+ Warnings:
4313
+ Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 60.
4296
4314
UPDATE mysql.column_stats
4297
4315
SET histogram='{"histogram_hb_v2":[{"start":"aaa", "size":0.25}]}'
4298
4316
WHERE table_name='t1_json';
4299
4317
FLUSH TABLES;
4300
4318
explain select * from t1_json limit 1;
4301
- ERROR HY000: Failed to parse histogram: .ndv member must be present and be a scalar at offset 20.
4319
+ id select_type table type possible_keys key key_len ref rows Extra
4320
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4321
+ Warnings:
4322
+ Warning 4186 Failed to parse histogram for table test.t1_json: "ndv" element not present at offset 48.
4302
4323
UPDATE mysql.column_stats
4303
4324
SET histogram='{"histogram_hb_v2":[{"start":"aaa", "size":0.25, "ndv":1}]}'
4304
4325
WHERE table_name='t1_json';
4305
4326
FLUSH TABLES;
4306
4327
explain select * from t1_json limit 1;
4307
- ERROR HY000: Failed to parse histogram: .end must be present in the last bucket and only there at offset 0.
4328
+ id select_type table type possible_keys key key_len ref rows Extra
4329
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4308
4330
UPDATE mysql.column_stats
4309
4331
SET histogram='{"histogram_hb_v2":[]}'
4310
4332
WHERE table_name='t1_json';
4311
4333
FLUSH TABLES;
4312
4334
explain select * from t1_json limit 1;
4313
- ERROR HY000: Failed to parse histogram: .end must be present in the last bucket and only there at offset 0.
4335
+ id select_type table type possible_keys key key_len ref rows Extra
4336
+ 1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
4337
+ Warnings:
4338
+ Warning 4186 Failed to parse histogram for table test.t1_json: Histogram must have at least one bucket at offset 21.
4314
4339
create table t2 (
4315
4340
city varchar(100)
4316
4341
);
0 commit comments