[MCOL-649] stored procedures only work in current database Created: 2017-03-30  Updated: 2019-07-10  Resolved: 2019-07-10

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

Type: Bug Priority: Major
Reporter: David Thompson (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 1
Labels: None

Epic Link: ColumnStore Compatibility Improvements

 Description   

If you have a stored procedeure querying a columnstore table without fully qualified table names as below, then it fails with no database set and fails differently if a different database is set. This does not happen if you have a similar proc referencing an innodb table.

setup conditions:

MariaDB [test]> create table tb1(i int) engine=columnstore;
Query OK, 0 rows affected (0.67 sec)
 
MariaDB [test]> insert into tb1 values (1), (2), (3);
Query OK, 3 rows affected (0.18 sec)
Records: 3  Duplicates: 0  Warnings: 0
 
MariaDB [test]> delimiter //
MariaDB [test]> create procedure tb1proc()  begin select sum(i) from tb1; end;//
Query OK, 0 rows affected (0.02 sec)
 
MariaDB [test]> delimiter ;

now exit and start mcsmysql without selecting a database:

MariaDB [(none)]> call test.tb1proc();
ERROR 1178 (42000): The storage engine for the table doesn't support This stored procedure syntax is not supported by Columnstore in this version
 
MariaDB [information_schema]> use flights
Database changed
MariaDB [flights]> call test.tb1proc();
ERROR 1146 (42S02): Table 'flights.tb1' doesn't exist
MariaDB [flights]> use test
Database changed
MariaDB [test]> call test.tb1proc();
+--------+
| sum(i) |
+--------+
|      6 |
+--------+
1 row in set (0.00 sec)



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-03-30 ]

We appear to parse stored procs in idb_vtable_process() without taking into account the DB...

Comment by Andrew Hutchings (Inactive) [ 2019-07-10 ]

Goes away in 1.4

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