1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

local merge

This commit is contained in:
Tor Didriksen
2011-09-26 14:29:27 +02:00
12 changed files with 380 additions and 92 deletions

View File

@ -45,7 +45,6 @@ use File::Basename;
my $plugindir_ini= "$ENV{PLUGIN_DIR}/daemon_example.ini";
my $notfound= "";
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
if ((!-e $daemonexample_ini) || (!-r $daemonexample_ini))

View File

@ -5,21 +5,6 @@
source include/not_embedded.inc;
source include/not_windows.inc;
# We need to use a plain "mysqld" without any other options to trigger
# the bug. In particular, it seems that passing --bootstrap does not
# trigger the bug. To do that, we extract the "command name" from the
# MYSQLD_BOOTSTRAP_CMD variable and store that in a file, which we
# then load into the test case.
perl;
my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
close FILE;
EOF
source $MYSQL_TMP_DIR/mysqld.inc;
# All these tests refer to configuration files that do not exist
--error 1
@ -44,4 +29,3 @@ exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
remove_file $MYSQL_TMP_DIR/mysqld.inc;

View File

@ -353,6 +353,14 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
exit(2);
EOF
# ----------------------------------------------------------------------------
# Check backtick and query_get_value, result should be empty
# ----------------------------------------------------------------------------
let $empty= `garbage`;
echo $empty is empty;
let $empty= query_get_value(nonsense, blabla, 1);
echo $empty is empty;
# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
@ -383,6 +391,71 @@ select 3 from t1 ;
--error 1
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test --enable and --disable with ONCE
# ----------------------------------------------------------------------------
--disable_abort_on_error ONCE
garbage;
--disable_abort_on_error ONCE
--remove_file DoesNotExist
--disable_result_log
select 2;
--enable_result_log ONCE
select 3;
select 5;
--enable_result_log
# ----------------------------------------------------------------------------
# Test cumulative ONCE
# ----------------------------------------------------------------------------
--disable_abort_on_error ONCE
--disable_query_log ONCE
select 3 from t1;
select 7;
--error 1
--exec echo "--disable_info OCNE" | $MYSQL_TEST 2>&1
--enable_connect_log ONCE
connect (con1,localhost,root,,);
connection default;
disconnect con1;
# ----------------------------------------------------------------------------
# Test ONCE can be combined with --error or modifiers like lowercase
# ----------------------------------------------------------------------------
--disable_result_log ONCE
--error ER_NO_SUCH_TABLE
select 5 from t1;
--disable_query_log ONCE
--lowercase_result
select "CASE" as "LOWER";
--sorted_result
--disable_query_log ONCE
select "xyz" as name union select "abc" as name order by name desc;
# ----------------------------------------------------------------------------
# Test --error with backtick operator or query_get_value
# ----------------------------------------------------------------------------
--error 0,ER_NO_SUCH_TABLE
let $empty= `SELECT foo from bar`;
echo $empty is empty;
--error 0,ER_BAD_FIELD_ERROR
let $empty= query_get_value(SELECT bar as foo, baz, 1);
echo $empty is empty;
--error 0,ER_NO_SUCH_TABLE
if (!`SELECT foo from bar`) {
echo "Yes it's empty";
}
# ----------------------------------------------------------------------------
# Test comments
@ -952,10 +1025,9 @@ while ($outer)
--source $MYSQLTEST_VARDIR/tmp/sourced.inc
--error ER_NO_SUCH_TABLE
SELECT * from nowhere;
--disable_abort_on_error
--disable_abort_on_error ONCE
# Statement giving a different error, to make sure we don't mask it
SELECT * FROM nowhere else;
--enable_abort_on_error
}
dec $outer;
inc $ifval;
@ -1104,9 +1176,8 @@ system echo "hej" > /dev/null;
--error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
--disable_abort_on_error
--disable_abort_on_error ONCE
system NonExistsinfComamdn 2> /dev/null;
--enable_abort_on_error
# ----------------------------------------------------------------------------
@ -2517,10 +2588,9 @@ INSERT INTO t1 SELECT f1 - 64 FROM t1;
INSERT INTO t1 SELECT f1 - 128 FROM t1;
INSERT INTO t1 SELECT f1 - 256 FROM t1;
INSERT INTO t1 SELECT f1 - 512 FROM t1;
--disable_result_log
--disable_result_log ONCE
--sorted_result
SELECT * FROM t1;
--enable_result_log
DROP TABLE t1;
# ----------------------------------------------------------------------------
@ -2568,11 +2638,9 @@ SELECT 0 as "WILL NOT lower case
--exec $MYSQL_TEST --help 2>&1 > /dev/null
--exec $MYSQL_TEST --version 2>&1 > /dev/null
--enable_query_log
--disable_abort_on_error
--disable_abort_on_error ONCE
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
--enable_abort_on_error
--enable_query_log
# ----------------------------------------------------------------------------
# test for query_get_value