[MCOL-684] Prepare statement with parameter substitution asserts in debug build Created: 2017-04-25  Updated: 2017-09-06  Resolved: 2017-09-06

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.1.0
Fix Version/s: 1.1.0

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

Issue Links:
PartOf
includes MCOL-841 Query aborts mysqld Closed

 Description   

After the MariaDB 10.2 merge, a simple PREPARE statement with substitution causes assert:

MariaDB [tpch1]> create table t1 (x int, y int) engine=columnstore;
Query OK, 0 rows affected (1.08 sec)

MariaDB [tpch1]> insert into t1 values (1, 1), (2, 2), (3, null);
Query OK, 3 rows affected (0.79 sec)
Records: 3 Duplicates: 0 Warnings: 0

MariaDB [tpch1]> prepare stmt1 from "select count from t1 where x = ?";
Query OK, 0 rows affected (0.00 sec)
Statement prepared

MariaDB [tpch1]> set @parm1=1;
Query OK, 0 rows affected (0.00 sec)

MariaDB [tpch1]> execute stmt1 using @parm1;
ERROR 2013 (HY000): Lost connection to MySQL server during query
MariaDB [tpch1]>

In addition, this statement should have a return type of INT, yet the assert is occurring in Item_func_get_user_var::val_real(). This bug also affects InnoDB tables accessed by the Columnstore build.

I believe the problem occurred in earlier builds, but there was no assert then.



 Comments   
Comment by David Hall (Inactive) [ 2017-08-02 ]

Prepare or execute breaks only if using <param> is included.

Comment by Daniel Lee (Inactive) [ 2017-09-06 ]

Build verified: 1.1.0 Github source

/root/columnstore/mariadb-columnstore-server
commit 9e855a6415e0edd6771c449a6591c21c3915bfec
Merge: 6ed33d1 c206e51
Author: David.Hall <david.hall@mariadb.com>
Date: Tue Sep 5 09:43:29 2017 -0500

Merge pull request #68 from mariadb-corporation/MCOL-887

MCOL-887 Merge MariaDB 10.2.8

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 4441206050b07986f31402652c3299d36007d78d
Merge: 90353b9 230d013
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Tue Sep 5 20:36:02 2017 +0100

Merge pull request #247 from mariadb-corporation/MCOL-579

Add compiler flag checks and hardening flags

Verified both with and without the debug flag for cmake.

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