[MCOL-793] ORDER BY NULL breaks subsequent query Created: 2017-06-28  Updated: 2017-07-13  Resolved: 2017-07-13

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.0.9
Fix Version/s: 1.0.10, 1.1.0

Type: Bug Priority: Major
Reporter: MG Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2017-14

 Description   

After an error, WHERE and LIMIT is ignored for Columnstore table



 Comments   
Comment by MG [ 2017-06-28 ]

MariaDB [test]> select @@version_comment\G
*************************** 1. row ***************************
@@version_comment: Columnstore 1.0.9-1
 1 row in set (0.00 sec)
 
MariaDB [test]> select id from t1 order by null limit 1;
ERROR 1054 (42S22): Unknown column 'NULL' in 'order clause'
 
MariaDB [test]> select id from t1 order by id limit 1;
+------+
| id   |
+------+
|    1 |
|    2 |
|    3 |
+------+
3 rows in set (0.00 sec)
 
MariaDB [test]> select id from t1 limit 1;
+------+
| id   |
+------+
|    1 |
+------+
1 row in set (0.01 sec)
 
MariaDB [test]> select id from t1 order by id limit 1;
+------+
| id   |
+------+
|    1 |
+------+
1 row in set (0.01 sec)
 
MariaDB [test]> select id from t1 order by null limit 1;
ERROR 1054 (42S22): Unknown column 'NULL' in 'order clause'
 
MariaDB [test]> select id from t1 where id=1;
+------+
| id   |
+------+
|    1 |
|    2 |
|    3 |
+------+
3 rows in set (0.00 sec)
 
MariaDB [test]> show create table t1\G
*************************** 1. row ***************************
        Table: t1
Create Table: CREATE TABLE `t1` (
  `id` int(11) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

Comment by Andrew Hutchings (Inactive) [ 2017-06-29 ]

Hi MG,

I keep trying to reply to your IRC messages, but you are gone by the time I wake up.

Interestingly this is only after an "ORDER BY NULL" and not any other invalid column. My guess is the server is setting a flag which doesn't get used due to the error and it gets used on the subsequent query. The ORDER BY is actually getting ignored too.

Comment by Andrew Hutchings (Inactive) [ 2017-07-11 ]

Pull requests in 1.0 and 1.1.

Patch stops ORDER BY NULL falling through and thinking that NULL is a column name.

Comment by Daniel Lee (Inactive) [ 2017-07-13 ]

Builds verified: Github source for 1.0.10 and 1.1.0

1.0.10-1

[root@localhost mariadb-columnstore-server]# git show
commit 435972e50ee33911ce39696ce101d1cd23ed9c2b
Merge: b1d1ca1 5d3fcfe
Author: David.Hall <david.hall@mariadb.com>
Date: Wed Jul 12 13:07:55 2017 -0500

[root@localhost mariadb-columnstore-engine]# git show
commit 3501c1a17a920ee765c6255c5a5fd8c64fed7c8e
Author: david hill <david.hill@mariadb.com>
Date: Wed Jul 12 09:52:28 2017 -0500

1.1.0-1

[root@localhost mariadb-columnstore-server]# git show
commit 8e07495da650d922c4d1f3f09d77382168132b11
Merge: 80e57a8 c27e1e5
Author: David.Hall <david.hall@mariadb.com>
Date: Wed Jul 12 13:07:42 2017 -0500

[root@localhost mariadb-columnstore-engine]# git show
commit d1386928dcaf1d9acc92ab11e2415c808c75dd49
Author: david hill <david.hill@mariadb.com>
Date: Thu Jul 13 11:20:08 2017 -0500

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