@@ -10247,55 +10247,44 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
10247
10247
EXPLAIN INSERT INTO t1
10248
10248
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
10249
10249
id select_type table type possible_keys key key_len ref rows Extra
10250
- 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 144 Using where
10251
- 2 DERIVED <derived4> ALL NULL NULL NULL NULL 12
10252
- 2 DERIVED t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
10250
+ 1 PRIMARY <derived4> ALL NULL NULL NULL NULL 12 Using temporary
10251
+ 1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
10253
10252
4 DERIVED t1 ALL NULL NULL NULL NULL 12
10254
10253
EXPLAIN FORMAT=JSON INSERT INTO t1
10255
10254
SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
10256
10255
EXPLAIN
10257
10256
{
10258
10257
"query_block": {
10259
10258
"select_id": 1,
10260
- "table": {
10261
- "table_name": "<derived2>",
10262
- "access_type": "ALL",
10263
- "rows": 144,
10264
- "filtered": 100,
10265
- "attached_condition": "t.f is not null",
10266
- "materialized": {
10267
- "query_block": {
10268
- "select_id": 2,
10269
- "table": {
10270
- "table_name": "<derived4>",
10271
- "access_type": "ALL",
10272
- "rows": 12,
10273
- "filtered": 100,
10274
- "materialized": {
10275
- "query_block": {
10276
- "select_id": 4,
10277
- "table": {
10278
- "table_name": "t1",
10279
- "access_type": "ALL",
10280
- "rows": 12,
10281
- "filtered": 100
10282
- }
10283
- }
10284
- }
10285
- },
10286
- "block-nl-join": {
10259
+ "temporary_table": {
10260
+ "table": {
10261
+ "table_name": "<derived4>",
10262
+ "access_type": "ALL",
10263
+ "rows": 12,
10264
+ "filtered": 100,
10265
+ "materialized": {
10266
+ "query_block": {
10267
+ "select_id": 4,
10287
10268
"table": {
10288
10269
"table_name": "t1",
10289
10270
"access_type": "ALL",
10290
10271
"rows": 12,
10291
- "filtered": 100,
10292
- "attached_condition": "t1.f is not null"
10293
- },
10294
- "buffer_type": "flat",
10295
- "buffer_size": "64",
10296
- "join_type": "BNL"
10272
+ "filtered": 100
10273
+ }
10297
10274
}
10298
10275
}
10276
+ },
10277
+ "block-nl-join": {
10278
+ "table": {
10279
+ "table_name": "t1",
10280
+ "access_type": "ALL",
10281
+ "rows": 12,
10282
+ "filtered": 100,
10283
+ "attached_condition": "t1.f is not null"
10284
+ },
10285
+ "buffer_type": "flat",
10286
+ "buffer_size": "64",
10287
+ "join_type": "BNL"
10299
10288
}
10300
10289
}
10301
10290
}
@@ -10326,43 +10315,33 @@ EXPLAIN
10326
10315
{
10327
10316
"query_block": {
10328
10317
"select_id": 1,
10329
- "table": {
10330
- "table_name": "<derived2>",
10331
- "access_type": "ALL",
10332
- "rows": 16,
10333
- "filtered": 100,
10334
- "attached_condition": "t.f is not null",
10335
- "materialized": {
10336
- "query_block": {
10337
- "select_id": 2,
10338
- "table": {
10339
- "table_name": "t1",
10340
- "access_type": "ALL",
10341
- "rows": 8,
10342
- "filtered": 100,
10343
- "attached_condition": "t1.f is not null"
10344
- },
10345
- "table": {
10346
- "table_name": "<derived4>",
10347
- "access_type": "ref",
10348
- "possible_keys": ["key0"],
10349
- "key": "key0",
10350
- "key_length": "4",
10351
- "used_key_parts": ["f"],
10352
- "ref": ["test.t1.f"],
10353
- "rows": 2,
10354
- "filtered": 100,
10355
- "materialized": {
10356
- "query_block": {
10357
- "select_id": 4,
10358
- "table": {
10359
- "table_name": "t1",
10360
- "access_type": "ALL",
10361
- "rows": 8,
10362
- "filtered": 100,
10363
- "attached_condition": "t1.f is not null"
10364
- }
10365
- }
10318
+ "temporary_table": {
10319
+ "table": {
10320
+ "table_name": "t1",
10321
+ "access_type": "ALL",
10322
+ "rows": 8,
10323
+ "filtered": 100,
10324
+ "attached_condition": "t1.f is not null"
10325
+ },
10326
+ "table": {
10327
+ "table_name": "<derived4>",
10328
+ "access_type": "ref",
10329
+ "possible_keys": ["key0"],
10330
+ "key": "key0",
10331
+ "key_length": "4",
10332
+ "used_key_parts": ["f"],
10333
+ "ref": ["test.t1.f"],
10334
+ "rows": 2,
10335
+ "filtered": 100,
10336
+ "materialized": {
10337
+ "query_block": {
10338
+ "select_id": 4,
10339
+ "table": {
10340
+ "table_name": "t1",
10341
+ "access_type": "ALL",
10342
+ "rows": 8,
10343
+ "filtered": 100,
10344
+ "attached_condition": "t1.f is not null"
10366
10345
}
10367
10346
}
10368
10347
}
@@ -19134,4 +19113,25 @@ FROM cte2
19134
19113
GROUP BY 1 ;
19135
19114
( SELECT 1 FROM ( SELECT 1 FROM cte1) dt GROUP BY x HAVING x= 1 )
19136
19115
1
19116
+ create table t1 (f int);
19117
+ create view v1 as select f, count(*) c from t1 group by f;
19118
+ #
19119
+ # MDEV-25012 Server crash in find_field_in_tables, Assertion `name' failed in find_field_in_table_ref
19120
+ #
19121
+ select * from v1 where export_set(1, default(f), 'x', aes_decrypt('secret', f));
19122
+ f c
19123
+ show warnings;
19124
+ Level Code Message
19125
+ drop view v1;
19126
+ drop table t1;
19127
+ create table t(c3 longtext) ;
19128
+ with cte1 as
19129
+ (
19130
+ select default(c3) as a
19131
+ from t group by 1
19132
+ )
19133
+ select * from cte1
19134
+ where cte1.a >= 1;
19135
+ a
19136
+ drop table t;
19137
19137
# End of 10.5 tests
0 commit comments