Commit e96885de authored by Sergei Golubchik's avatar Sergei Golubchik

fixed for mysql-test-run to

* fully support --mysqld=--plugin-load=xxxx
* uniformly support all loadable plugins, no need to hard-code
  every new plugin in mtr
* autodetect MTR_VS_CONFIG on windows
parent 14e53d06
......@@ -5,9 +5,9 @@
--source include/have_dynamic_loading.inc
#
# Check if the variable EXAMPLE_PLUGIN is set
# Check if the variable HA_EXAMPLE_SO is set
#
--require r/have_example_plugin.require
disable_query_log;
eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin';
eval select LENGTH('$HA_EXAMPLE_SO') > 0 as 'have_example_plugin';
enable_query_log;
......@@ -9,5 +9,5 @@
#
--require r/have_simple_parser.require
disable_query_log;
eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
eval select LENGTH('$MYPLUGLIB_SO') > 0 as 'have_simple_parser';
enable_query_log;
......@@ -9,5 +9,5 @@
#
--require r/have_udf_example.require
disable_query_log;
eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib';
eval select LENGTH('$UDF_EXAMPLE_SO') > 0 as 'have_udf_example_lib';
enable_query_log;
......@@ -27,13 +27,13 @@ drop table if exists t1;
--echo "*** Test 1) Test UDFs via loadable libraries ***
--echo "Running on the master"
--enable_info
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_CANT_FIND_DL_ENTRY
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func ORDER BY name;
--disable_info
......
......@@ -18,7 +18,7 @@ use strict;
use Exporter;
use base "Exporter";
our @EXPORT= qw / rmtree mkpath copytree /;
our @EXPORT= qw /rmtree mkpath copytree/;
use File::Find;
use File::Copy;
......
......@@ -55,7 +55,7 @@ sub collect_option {
}
use File::Basename;
use File::Spec::Functions qw / splitdir /;
use File::Spec::Functions qw /splitdir/;
use IO::File();
use My::Config;
use My::Platform;
......@@ -68,22 +68,9 @@ require "mtr_misc.pl";
my $do_test_reg;
my $skip_test_reg;
# Related to adding InnoDB plugin combinations
my $lib_innodb_plugin;
# If "Quick collect", set to 1 once a test to run has been found.
my $some_test_found;
sub find_innodb_plugin {
$lib_innodb_plugin=
my_find_file($::basedir,
["storage/innodb_plugin", "storage/innodb_plugin/.libs",
"lib/mysql/plugin", "lib/mariadb/plugin", "lib/plugin"],
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
"ha_innodb_plugin.sl"],
NOT_REQUIRED);
}
sub init_pattern {
my ($from, $what)= @_;
return undef unless defined $from;
......@@ -116,8 +103,6 @@ sub collect_test_cases ($$$) {
$do_test_reg= init_pattern($do_test, "--do-test");
$skip_test_reg= init_pattern($skip_test, "--skip-test");
&find_innodb_plugin;
# If not reordering, we also shouldn't group by suites, unless
# no test cases were named.
# This also effects some logic in the loop following this.
......@@ -966,36 +951,6 @@ sub collect_one_test_case {
return $tinfo;
}
}
elsif ( $tinfo->{'innodb_plugin_test'} )
{
# This is a test that needs the innodb plugin
if (!&find_innodb_plugin)
{
# innodb plugin is not supported, skip it
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No innodb plugin support";
return $tinfo;
}
my $sep= (IS_WINDOWS) ? ';' : ':';
my $plugin_filename= basename($lib_innodb_plugin);
my $plugin_list=
"innodb=$plugin_filename$sep" .
"innodb_trx=$plugin_filename$sep" .
"innodb_locks=$plugin_filename$sep" .
"innodb_lock_waits=$plugin_filename$sep" .
"innodb_cmp=$plugin_filename$sep" .
"innodb_cmp_reset=$plugin_filename$sep" .
"innodb_cmpmem=$plugin_filename$sep" .
"innodb_cmpmem_reset=$plugin_filename";
foreach my $k ('master_opt', 'slave_opt')
{
push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
}
}
else
{
push(@{$tinfo->{'master_opt'}}, "--loose-skip-innodb");
......@@ -1113,7 +1068,7 @@ sub collect_one_test_case {
if ( $tinfo->{'example_plugin_test'} )
{
if ( !$ENV{'EXAMPLE_PLUGIN'} )
if ( !$ENV{'HA_EXAMPLE_SO'} )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "Test requires the 'example' plugin";
......@@ -1165,7 +1120,7 @@ my @tags=
["include/have_innodb.inc", "innodb_test", 1],
["include/have_pbxt.inc", "pbxt_test", 1],
["include/have_innodb_plugin.inc", "innodb_plugin_test", 1],
["include/have_innodb_plugin.inc", "innodb_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
......
This diff is collapsed.
......@@ -859,6 +859,9 @@ TABLE_NAME COLUMN_NAME PRIVILEGES
COLUMNS TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select
FILES TABLE_NAME select
INNODB_BUFFER_POOL_PAGES_INDEX table_name select
INNODB_INDEX_STATS table_name select
INNODB_TABLE_STATS table_name select
KEY_COLUMN_USAGE TABLE_NAME select
PARTITIONS TABLE_NAME select
REFERENTIAL_CONSTRAINTS TABLE_NAME select
......@@ -867,9 +870,6 @@ TABLES TABLE_NAME select
TABLE_CONSTRAINTS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
VIEWS TABLE_NAME select
INNODB_BUFFER_POOL_PAGES_INDEX table_name select
INNODB_TABLE_STATS table_name select
INNODB_INDEX_STATS table_name select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
......
......@@ -2,8 +2,5 @@ show variables like 'ignore_builtin_innodb';
Variable_name Value
ignore_builtin_innodb ON
select PLUGIN_NAME from information_schema.plugins
where PLUGIN_NAME = "InnoDb";
where PLUGIN_NAME = "InnoDb" and PLUGIN_LIBRARY IS NULL;
PLUGIN_NAME
select ENGINE from information_schema.engines
where ENGINE = "InnoDB";
ENGINE
......@@ -14,26 +14,26 @@ drop table if exists t1;
# Create the example functions from udf_example
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_CANT_FIND_DL_ENTRY
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION reverse_lookup
RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE AGGREGATE FUNCTION avgcost
RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--error ER_CANT_INITIALIZE_UDF
select myfunc_double();
......@@ -207,14 +207,14 @@ CREATE FUNCTION metaphon(a int) RETURNS int
return 0;
# this currently passes, and eclipse the stored function
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION metaphon;
DROP FUNCTION metaphon;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--error ER_UDF_EXISTS
CREATE FUNCTION metaphon(a int) RETURNS int
......@@ -245,8 +245,8 @@ DROP FUNCTION avgcost;
# the UDF
#
select * from mysql.func;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
select IS_const(3);
......@@ -260,8 +260,8 @@ select is_const(3);
#
# Bug#18761: constant expression as UDF parameters not passed in as constant
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
select
is_const(3) as const,
......@@ -300,14 +300,14 @@ drop function if exists is_const;
# Bug #25382: Passing NULL to an UDF called from stored procedures
# crashes server
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
delimiter //;
create function f1(p1 varchar(255))
......@@ -345,8 +345,8 @@ drop function myfunc_int;
# Bug #28921: Queries containing UDF functions are cached
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
create table t1 (a char);
set GLOBAL query_cache_size=1355776;
......@@ -374,8 +374,8 @@ DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest;
USE mysqltest;
DROP DATABASE mysqltest;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION metaphon;
USE test;
......@@ -403,8 +403,8 @@ insert into const_len_bug values(str_const, result, "");
END |
DELIMITER ;|
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_SO";
CALL check_const_len_sp("foo");
......@@ -420,8 +420,8 @@ DROP TABLE const_len_bug;
# Bug #30355: Incorrect ordering of UDF results
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (4),(3),(2),(1);
......
--skip-grant-tables $EXAMPLE_PLUGIN_OPT
--skip-grant-tables
......@@ -7,7 +7,7 @@
--replace_regex /\.dll/.so/
--error ER_OPTION_PREVENTS_STATEMENT
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
--replace_regex /\.dll/.so/
--error ER_OPTION_PREVENTS_STATEMENT
......
......@@ -531,6 +531,7 @@ drop table t1;
grant select on test.* to mysqltest_4@localhost;
connect (user10261,localhost,mysqltest_4,,);
connection user10261;
--sorted_result
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME';
connection default;
......
......@@ -3,6 +3,4 @@
#
show variables like 'ignore_builtin_innodb';
select PLUGIN_NAME from information_schema.plugins
where PLUGIN_NAME = "InnoDb";
select ENGINE from information_schema.engines
where ENGINE = "InnoDB";
where PLUGIN_NAME = "InnoDb" and PLUGIN_LIBRARY IS NULL;
......@@ -44,7 +44,7 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
# See also Bug#32034.
--echo Test that bad value for plugin enum option is rejected correctly.
--error 7
--exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables $EXAMPLE_PLUGIN_OPT --plugin-load=EXAMPLE=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--exec $MYSQLD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
#
# Test that an wrong option with --help --verbose gives an error
......
......@@ -5,15 +5,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
DROP TABLE t1;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
--replace_regex /\.dll/.so/
--error 1125
eval INSTALL PLUGIN EXAMPLE SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN EXAMPLE SONAME '$HA_EXAMPLE_SO';
UNINSTALL PLUGIN example;
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
......@@ -35,7 +35,7 @@ UNINSTALL PLUGIN non_exist;
--echo # to impossible int val
--echo #
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
SET GLOBAL example_enum_var= e1;
SET GLOBAL example_enum_var= e2;
......@@ -50,7 +50,7 @@ UNINSTALL PLUGIN example;
# Bug #32757 hang with sql_mode set when setting some global variables
#
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
select @@session.sql_mode into @old_sql_mode;
......
$EXAMPLE_PLUGIN_OPT
$EXAMPLE_PLUGIN_LOAD
--plugin-load=EXAMPLE=$HA_EXAMPLE_SO
--loose-plugin-example-enum-var=e2
......@@ -8,7 +8,7 @@
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
connect(con1,localhost,bug51770,,);
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
--error ER_TABLEACCESS_DENIED_ERROR
UNINSTALL PLUGIN example;
connection default;
......
......@@ -14,26 +14,26 @@ drop table if exists t1;
# Create the example functions from udf_example
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_CANT_FIND_DL_ENTRY
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION reverse_lookup
RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE AGGREGATE FUNCTION avgcost
RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--error ER_CANT_INITIALIZE_UDF
select myfunc_double();
......@@ -210,14 +210,14 @@ CREATE FUNCTION metaphon(a int) RETURNS int
return 0;
# this currently passes, and eclipse the stored function
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION metaphon;
DROP FUNCTION metaphon;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--error ER_UDF_EXISTS
CREATE FUNCTION metaphon(a int) RETURNS int
......@@ -248,8 +248,8 @@ DROP FUNCTION avgcost;
# the UDF
#
select * from mysql.func;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
select IS_const(3);
......@@ -263,8 +263,8 @@ select is_const(3);
#
# Bug#18761: constant expression as UDF parameters not passed in as constant
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
select
is_const(3) as const,
......@@ -303,14 +303,14 @@ drop function if exists is_const;
# Bug #25382: Passing NULL to an UDF called from stored procedures
# crashes server
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
delimiter //;
create function f1(p1 varchar(255))
......@@ -354,8 +354,8 @@ DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest;
USE mysqltest;
DROP DATABASE mysqltest;
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION metaphon;
USE test;
......@@ -383,8 +383,8 @@ insert into const_len_bug values(str_const, result, "");
END |
DELIMITER ;|
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION check_const_len RETURNS string SONAME "$UDF_EXAMPLE_SO";
CALL check_const_len_sp("foo");
......@@ -400,8 +400,8 @@ DROP TABLE const_len_bug;
# Bug #30355: Incorrect ordering of UDF results
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION sequence RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (4),(3),(2),(1);
......
......@@ -14,8 +14,8 @@ drop table if exists t1;
# Bug #28921: Queries containing UDF functions are cached
#
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
create table t1 (a char);
set GLOBAL query_cache_size=1355776;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment