[MCOL-3689] SELECT executed after EXPLAIN returns ER_INTERNAL_ERROR Created: 2019-12-25  Updated: 2023-10-25  Resolved: 2023-10-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: 1.4.2
Fix Version/s: Icebox

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Roman
Resolution: Fixed Votes: 1
Labels: None

Attachments: File columnstoreSupportReport.columnstore-1.tar.gz    
Issue Links:
Relates
relates to MCOL-3766 EXPLAIN gives error every other try Closed

 Description   

drop table if exists t1;
create table t1 (a int) engine=Columnstore;
explain select * from t1;
select * from t1;

MariaDB f93bfb9288d020b190f5c73a31223fff6439687d

MariaDB [db]> drop table if exists t1;
Query OK, 0 rows affected (0.403 sec)
 
MariaDB [db]> create table t1 (a int) engine=Columnstore;
Query OK, 0 rows affected (0.443 sec)
 
MariaDB [db]> explain select * from t1;
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.045 sec)
 
MariaDB [db]> select * from t1;
ERROR 1815 (HY000): Internal error: Unknown error

Reproducible reliably for me on a local build from the indicated revision, on empty and non-empty tables.
EXPLAIN can be replaced with ANALYZE or ANALYZE FORMAT=JSON without changing the outcome.
Next SELECT returns the expected result.
Columnstore support report is attached.



 Comments   
Comment by Roman [ 2020-07-13 ]

10.5.4 doesn't have issues with EXPLAIN but ANALYZE still produce the failure.

MariaDB [test]> explain select * from cs2;
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.000 sec)
 
MariaDB [test]> select * from cs2;
Empty set (0.010 sec)
 
MariaDB [test]> explain select * from cs2;
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.000 sec)
 
MariaDB [test]> explain select * from cs2;
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.000 sec)
 
MariaDB [test]> select * from cs2;
Empty set (0.010 sec)
 
MariaDB [test]> ANALYZE select * from cs2;
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL   |     NULL |       NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
1 row in set (0.005 sec)
 
MariaDB [test]> select * from cs2;
ERROR 1815 (HY000): Internal error: Unknown error
MariaDB [test]> ANALYZE select * from cs2;
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
| id   | select_type   | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra |
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
|    1 | PUSHED SELECT | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | NULL   |     NULL |       NULL | NULL  |
+------+---------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
1 row in set (0.006 sec)
 
MariaDB [test]> select * from cs2;
ERROR 1815 (HY000): Internal error: Unknown error
MariaDB [test]> select * from cs2;
Empty set (0.008 sec)

Comment by Gregory Dorman (Inactive) [ 2021-03-23 ]

I just verified it in 5.5.2. Most likely it was corrected much earlier. For bookkeeping purposes, and given that 5.5.2 is out, let's verify and officially close in 5.6.1. This would pull it into release notes, so we can inform the world.

Comment by Daniel Lee (Inactive) [ 2021-03-23 ]

Build tested: 5.5.2-1, 5.5.6 (Drone #1915)

Tested both versions. The ANALYSIS error still exist.

MariaDB [mytest]> drop table t1;
Query OK, 0 rows affected (0.141 sec)

MariaDB [mytest]> drop table if exists t1;
Query OK, 0 rows affected, 1 warning (0.020 sec)

MariaDB [mytest]> create table t1 (a int) engine=Columnstore;
Query OK, 0 rows affected (0.127 sec)

MariaDB [mytest]> explain select * from t1;
-----------------------------------------------------------------+

id select_type table type possible_keys key key_len ref rows Extra

-----------------------------------------------------------------+

1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL

-----------------------------------------------------------------+
1 row in set (0.000 sec)

MariaDB [mytest]> select * from t1;
Empty set (0.062 sec)

MariaDB [mytest]> ANALYZE select * from t1;
-----------------------------------------------------------------------------------------

id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra

-----------------------------------------------------------------------------------------

1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL

-----------------------------------------------------------------------------------------
1 row in set (0.007 sec)

MariaDB [mytest]> select * from t1;
ERROR 1815 (HY000): Internal error: Unknown error
MariaDB [mytest]> select * from t1;
Empty set (0.010 sec)

Generated at Thu Feb 08 02:44:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.