diff options
author | unknown <konstantin@mysql.com> | 2004-11-05 22:02:07 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-11-05 22:02:07 +0300 |
commit | 01df29fdd57c091cd36ad26828734a3f7f7e6faa (patch) | |
tree | 6506efd1bf1a077deccfa6ecc196387ffbc38906 /mysql-test | |
parent | f833dc815b9c69e13a2e0032419555b36147666d (diff) | |
download | mariadb-git-01df29fdd57c091cd36ad26828734a3f7f7e6faa.tar.gz |
A fix and test case for Bug#6102 "Server crash with prepared statement
and blank after function name".
Crop fruits of copy-paste programming: pre-caching of stored functions
wasn't performed for prepared statements just because implementation
of prepared statements is done as an add-on to the main execution flow,
and the preload was originally implemented for main execution branch
only (mysql_execute_command).
mysql-test/r/ps.result:
Test results fixed: bug#6102
mysql-test/t/ps.test:
A test case for Bug#6102 "Server crash with prepared statement
and blank after functionname"
sql/sql_prepare.cc:
A fix for Bug#6102 "Server crash with prepared statement and blank
after functionname": we need to preload stored functions from system tables
before we open any other tables.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ps.result | 5 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 82e59835cf9..74b9fb9202b 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -456,3 +456,8 @@ PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVIN EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +create table t1 (a varchar(20)); +insert into t1 values ('foo'); +prepare stmt FROM 'SELECT char_length (a) FROM t1'; +ERROR 42000: FUNCTION test.char_length does not exist +drop table t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 978ce2bc2c3..8bd535a08ec 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -462,3 +462,14 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# Bug#6102 "Server crash with prepared statement and blank after +# function name" +# ensure that stored functions are cached when preparing a statement +# before we open tables +# +create table t1 (a varchar(20)); +insert into t1 values ('foo'); +--error 1305 +prepare stmt FROM 'SELECT char_length (a) FROM t1'; +drop table t1; |