mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint include/my_global.h: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/lib/mtr_process.pl: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/mysqladmin.test: Auto merged mysql-test/t/rpl_rotate_logs.test: Auto merged scripts/make_binary_distribution.sh: Auto merged scripts/mysqlbug.sh: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item_sum.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_class.h: Auto merged Makefile.am: manual merge mysql-test/t/trigger.test: manual merge strings/ctype-extra.c: manual merge
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
# Copyright (C) 2000-2006 MySQL AB
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
@ -1,3 +1,4 @@
|
||||
--source include/not_embedded.inc
|
||||
--source ./include/have_federated_db.inc
|
||||
|
||||
source ./include/master-slave.inc;
|
||||
|
@ -1,6 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 1997-2006 MySQL AB
|
||||
# For a more info consult the file COPYRIGHT distributed with this file
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This scripts creates the privilege tables db, host, user, tables_priv,
|
||||
# columns_priv in the mysql database, as well as the func table.
|
||||
@ -55,14 +67,17 @@ fi
|
||||
mdata=$data/mysql
|
||||
EXTRA_ARG=""
|
||||
|
||||
if test ! -x $execdir/mysqld
|
||||
mysqld=
|
||||
if test -x $execdir/mysqld
|
||||
then
|
||||
mysqld=$execdir/mysqld
|
||||
else
|
||||
if test ! -x $libexecdir/mysqld
|
||||
then
|
||||
echo "mysqld is missing - looked in $execdir and in $libexecdir"
|
||||
exit 1
|
||||
else
|
||||
execdir=$libexecdir
|
||||
mysqld=$libexecdir/mysqld
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -88,8 +103,11 @@ basedir=.
|
||||
EXTRA_ARG="--language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/"
|
||||
fi
|
||||
|
||||
mysqld_boot=" $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \
|
||||
--basedir=$basedir --datadir=$ldata --skip-innodb --skip-ndbcluster --skip-bdb \
|
||||
mysqld_boot="${MYSQLD_BOOTSTRAP-$mysqld}"
|
||||
|
||||
mysqld_boot="$mysqld_boot --no-defaults --bootstrap --skip-grant-tables \
|
||||
--basedir=$basedir --datadir=$ldata \
|
||||
--skip-innodb --skip-ndbcluster --skip-bdb \
|
||||
$EXTRA_ARG"
|
||||
echo "running $mysqld_boot"
|
||||
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2005-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004, 2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2005-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This is a library file used by the Perl version of mysql-test-run,
|
||||
# and is part of the translation of the Bourne shell script with the
|
||||
|
@ -1,3 +1,19 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#
|
||||
# This file is used from mysql-test-run.pl when choosing
|
||||
# port numbers and directories to use for running mysqld.
|
||||
|
@ -1,3 +1,18 @@
|
||||
/* Copyright (C) 2004-2005 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef __WIN__
|
||||
|
@ -2901,12 +2901,19 @@ sub install_db ($$) {
|
||||
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
|
||||
}
|
||||
|
||||
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
|
||||
# configure --disable-grant-options), mysqld will not recognize the
|
||||
# --bootstrap or --skip-grant-tables options. The user can set
|
||||
# MYSQLD_BOOTSTRAP to the full path to a mysqld which does accept
|
||||
# --bootstrap, to accommodate this.
|
||||
my $exe_mysqld_bootstrap = $ENV{'MYSQLD_BOOTSTRAP'} || $exe_mysqld;
|
||||
|
||||
# Log bootstrap command
|
||||
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
|
||||
mtr_tofile($path_bootstrap_log,
|
||||
"$exe_mysqld " . join(" ", @$args) . "\n");
|
||||
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
|
||||
|
||||
if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp,
|
||||
if ( mtr_run($exe_mysqld_bootstrap, $args, $init_db_sql_tmp,
|
||||
$path_bootstrap_log, $path_bootstrap_log,
|
||||
"", { append_log_file => 1 }) != 0 )
|
||||
|
||||
|
@ -292,6 +292,14 @@ void install_db(char *datadir)
|
||||
die("Unable to create init_db.sql.");
|
||||
/* args */
|
||||
init_args(&al);
|
||||
/*
|
||||
XXX: If mysqld is compiled with DISABLE_GRANT_OPTIONS defined, it
|
||||
will not recognize the --bootstrap, --init-file or --skip-grant-
|
||||
tables options. If this is needed here, please check
|
||||
MYSQLD_BOOTSTRAP in the environment, and use its value instead of
|
||||
mysqld_file if it is set. See mysql-test-run.pl and
|
||||
mysql_install_db.
|
||||
*/
|
||||
add_arg(&al, mysqld_file);
|
||||
add_arg(&al, "--no-defaults");
|
||||
add_arg(&al, "--bootstrap");
|
||||
|
@ -1,6 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2004 MySQL AB
|
||||
# For a more info consult the file COPYRIGHT distributed with this file
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This scripts starts the table handler ndbcluster
|
||||
|
||||
|
@ -1928,38 +1928,4 @@ create table t1 (a int) engine=bdb;
|
||||
commit;
|
||||
alter table t1 add primary key(a);
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
reset master;
|
||||
create table bug16206 (a int);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
||||
f n Query 1 n use `test`; create table bug16206 (a int)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(1)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(2)
|
||||
drop table bug16206;
|
||||
reset master;
|
||||
create table bug16206 (a int) engine= bdb;
|
||||
insert into bug16206 values(0);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
insert into bug16206 values(3);
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
||||
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
|
||||
f n Query 1 n use `test`; insert into bug16206 values(0)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(1)
|
||||
f n Query 1 n use `test`; BEGIN
|
||||
f n Query 1 n use `test`; insert into bug16206 values(2)
|
||||
f n Query 1 n use `test`; COMMIT
|
||||
f n Query 1 n use `test`; insert into bug16206 values(3)
|
||||
drop table bug16206;
|
||||
set autocommit=0;
|
||||
End of 5.0 tests
|
||||
|
@ -37,18 +37,3 @@ show create database test;
|
||||
Database Create Database
|
||||
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
drop table t1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
commit;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
15
mysql-test/r/flush_block_commit_notembedded.result
Normal file
15
mysql-test/r/flush_block_commit_notembedded.result
Normal file
@ -0,0 +1,15 @@
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
commit;
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 98
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
@ -299,12 +299,6 @@ select count(*) from t2;
|
||||
count(*)
|
||||
25500
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
insert delayed into v1 values (1);
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
create table t1 (id int primary key, data int);
|
||||
insert into t1 values (1, 1), (2, 2), (3, 3);
|
||||
select row_count();
|
||||
|
107
mysql-test/r/insert_notembedded.result
Normal file
107
mysql-test/r/insert_notembedded.result
Normal file
@ -0,0 +1,107 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
insert delayed into v1 values (1);
|
||||
ERROR HY000: 'test.v1' is not BASE TABLE
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
CREATE DATABASE meow;
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
SELECT * FROM table_target;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target2;
|
||||
mexs_id messzeit
|
||||
12X45Y78 2006-07-12 07:50:00
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target3;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
DROP DATABASE meow;
|
@ -705,103 +705,3 @@ use bug21774_1;
|
||||
INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
|
||||
DROP DATABASE bug21774_1;
|
||||
DROP DATABASE bug21774_2;
|
||||
CREATE DATABASE meow;
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target'
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'view_target2'
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
ERROR 42000: INSERT,DELETE command denied to user 'user20989'@'localhost' for table 'table_target2'
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
SELECT * FROM table_target;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target2;
|
||||
mexs_id messzeit
|
||||
12X45Y78 2006-07-12 07:50:00
|
||||
87654321 2006-07-12 07:50:00
|
||||
SELECT * FROM view_target3;
|
||||
mexs_id messzeit
|
||||
87654321 2006-07-12 07:50:00
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
DROP DATABASE meow;
|
||||
|
@ -700,8 +700,8 @@ ERROR 42S22: Unknown column 't1.b' in 'on clause'
|
||||
select * from information_schema.statistics join information_schema.columns
|
||||
using(table_name,column_name) where table_name='user';
|
||||
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
user User NULL mysql 0 mysql PRIMARY 2 A 5 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
|
||||
user User NULL mysql 0 mysql PRIMARY 2 A 5 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
@ -133,6 +133,21 @@ a b c
|
||||
6 7 2
|
||||
7 8 3
|
||||
8 2 3
|
||||
create unique index bi using hash on t2(b);
|
||||
insert into t2 values(9, 3, 1);
|
||||
ERROR 23000: Duplicate entry '' for key 0
|
||||
alter table t2 drop index bi;
|
||||
insert into t2 values(9, 3, 1);
|
||||
select * from t2 order by a;
|
||||
a b c
|
||||
2 3 5
|
||||
3 4 6
|
||||
4 5 8
|
||||
5 6 2
|
||||
6 7 2
|
||||
7 8 3
|
||||
8 2 3
|
||||
9 3 1
|
||||
drop table t2;
|
||||
CREATE TABLE t2 (
|
||||
a int unsigned NOT NULL PRIMARY KEY,
|
||||
|
@ -2686,12 +2686,12 @@ View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select (year(now()) - year(`t1`.`DOB`)) AS `Age` from `t1` having (`Age` < 75)
|
||||
SELECT (year(now())-year(DOB)) AS Age FROM t1 HAVING Age < 75;
|
||||
Age
|
||||
42
|
||||
38
|
||||
43
|
||||
39
|
||||
SELECT * FROM v1;
|
||||
Age
|
||||
42
|
||||
38
|
||||
43
|
||||
39
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a char(6) DEFAULT 'xxx');
|
||||
|
@ -1,6 +1,3 @@
|
||||
# This test should work in embedded server after we fix mysqltest
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# This test is a bit tricky as we can't use backup table to overwrite an old
|
||||
# table
|
||||
|
@ -1019,39 +1019,4 @@ commit;
|
||||
alter table t1 add primary key(a);
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
|
||||
#
|
||||
set autocommit=1;
|
||||
|
||||
let $VERSION=`select version()`;
|
||||
|
||||
reset master;
|
||||
create table bug16206 (a int);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 1 f 2 n 5 n
|
||||
show binlog events;
|
||||
drop table bug16206;
|
||||
|
||||
reset master;
|
||||
create table bug16206 (a int) engine= bdb;
|
||||
insert into bug16206 values(0);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
insert into bug16206 values(3);
|
||||
--replace_result $VERSION VERSION
|
||||
--replace_column 1 f 2 n 5 n
|
||||
show binlog events;
|
||||
drop table bug16206;
|
||||
|
||||
set autocommit=0;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1,11 +1,10 @@
|
||||
# delayed works differently in embedded server
|
||||
--source include/not_embedded.inc
|
||||
#
|
||||
# test of DELAYED insert and timestamps
|
||||
# (Can't be tested with purify :( )
|
||||
#
|
||||
|
||||
# This tests not performed with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
@ -1,3 +1,6 @@
|
||||
# In embedded server we don't really have a control over stack usage
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# Bug#21476: Lost Database Connection During Query
|
||||
#
|
||||
|
@ -75,24 +75,3 @@ show create database test;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
|
||||
connection con1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
connection con2;
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
connection con1;
|
||||
send commit;
|
||||
connection con2;
|
||||
sleep 1;
|
||||
show master status;
|
||||
unlock tables;
|
||||
connection con1;
|
||||
reap;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
||||
|
32
mysql-test/t/flush_block_commit_notembedded.test
Normal file
32
mysql-test/t/flush_block_commit_notembedded.test
Normal file
@ -0,0 +1,32 @@
|
||||
# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing
|
||||
# transactions.
|
||||
# We verify that we did not introduce a deadlock.
|
||||
# This is intended to mimick how mysqldump and innobackup work.
|
||||
|
||||
# And it requires InnoDB
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
|
||||
connection con1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
reset master;
|
||||
set autocommit=0;
|
||||
insert t1 values (1);
|
||||
connection con2;
|
||||
flush tables with read lock;
|
||||
show master status;
|
||||
connection con1;
|
||||
send commit;
|
||||
connection con2;
|
||||
sleep 1;
|
||||
show master status;
|
||||
unlock tables;
|
||||
connection con1;
|
||||
reap;
|
||||
drop table t1;
|
||||
set autocommit=1;
|
||||
|
@ -1,3 +1,7 @@
|
||||
# this test mostly test privilege control (what doesn't work
|
||||
# in the embedded server by default). So disabled in embedded-server mode
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
-- source include/testdb_only.inc
|
||||
|
||||
--disable_warnings
|
||||
|
@ -2154,6 +2154,7 @@ select * from t1, t2
|
||||
drop table t1, t2;
|
||||
|
||||
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
|
||||
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ /
|
||||
--error 1005
|
||||
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
|
||||
|
||||
|
@ -176,18 +176,6 @@ insert into t2 select t1.* from t1, t2 t, t3 where t1.id1 = t.id2 and t.id2 =
|
||||
select count(*) from t2;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Test for INSERT DELAYED INTO a <view>
|
||||
# BUG#13683: INSERT DELAYED into a view creates an infinite loop
|
||||
#
|
||||
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
--error 1347
|
||||
insert delayed into v1 values (1);
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
#
|
||||
# Test for values returned by ROW_COUNT() function
|
||||
# (and thus for values returned by mysql_affected_rows())
|
||||
|
154
mysql-test/t/insert_notembedded.test
Normal file
154
mysql-test/t/insert_notembedded.test
Normal file
@ -0,0 +1,154 @@
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# Test for INSERT DELAYED INTO a <view>
|
||||
# BUG#13683: INSERT DELAYED into a view creates an infinite loop
|
||||
#
|
||||
|
||||
create table t1 (n int);
|
||||
create view v1 as select * from t1;
|
||||
--error 1347
|
||||
insert delayed into v1 values (1);
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
#
|
||||
# Bug #20989: View '(null).(null)' references invalid table(s)... on
|
||||
# SQL SECURITY INVOKER
|
||||
#
|
||||
# this is really the fact that REPLACE ... SELECT required additional
|
||||
# INSERT privs (on tables that are part of a view) over the related
|
||||
# REPLACE, SELECT
|
||||
#
|
||||
|
||||
CREATE DATABASE meow;
|
||||
|
||||
connect (root,localhost,root,,meow);
|
||||
connection root;
|
||||
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1356
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
SELECT * FROM table_target;
|
||||
SELECT * FROM view_target2;
|
||||
SELECT * FROM view_target3;
|
||||
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
|
||||
disconnect root;
|
||||
|
||||
connection default;
|
||||
|
||||
DROP DATABASE meow;
|
@ -266,140 +266,3 @@ INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
|
||||
DROP DATABASE bug21774_1;
|
||||
DROP DATABASE bug21774_2;
|
||||
|
||||
#
|
||||
# Bug #20989: View '(null).(null)' references invalid table(s)... on
|
||||
# SQL SECURITY INVOKER
|
||||
#
|
||||
# this is really the fact that REPLACE ... SELECT required additional
|
||||
# INSERT privs (on tables that are part of a view) over the related
|
||||
# REPLACE, SELECT
|
||||
#
|
||||
|
||||
CREATE DATABASE meow;
|
||||
|
||||
connect (root,localhost,root,,meow);
|
||||
connection root;
|
||||
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2;
|
||||
CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3;
|
||||
|
||||
CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE);
|
||||
INSERT INTO table_stations VALUES ('87654321','XXXX','YY');
|
||||
|
||||
CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country));
|
||||
INSERT INTO table_countries VALUES ('YY','Entenhausen');
|
||||
|
||||
CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country)));
|
||||
|
||||
CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id));
|
||||
INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00');
|
||||
|
||||
GRANT SELECT ON table_source TO user20989@localhost;
|
||||
GRANT SELECT ON table_countries TO user20989@localhost;
|
||||
GRANT SELECT ON table_stations TO user20989@localhost;
|
||||
GRANT SELECT ON view_stations TO user20989@localhost;
|
||||
GRANT SELECT ON table_target TO user20989@localhost;
|
||||
GRANT SELECT ON table_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1356
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
|
||||
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
|
||||
|
||||
connect (user20989,localhost,user20989,,meow);
|
||||
connection user20989;
|
||||
|
||||
REPLACE INTO table_target
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN table_target AS old
|
||||
USING (mexs_id);
|
||||
|
||||
--error 1142
|
||||
REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00');
|
||||
REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00');
|
||||
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target2
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target2 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
REPLACE INTO view_target3
|
||||
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
|
||||
FROM table_source
|
||||
INNER JOIN view_stations AS stations
|
||||
ON table_source.id = stations.icao
|
||||
LEFT JOIN view_target3 AS old
|
||||
USING (mexs_id);
|
||||
|
||||
connection root;
|
||||
disconnect user20989;
|
||||
|
||||
SELECT * FROM table_target;
|
||||
SELECT * FROM view_target2;
|
||||
SELECT * FROM view_target3;
|
||||
|
||||
DROP VIEW view_stations;
|
||||
DROP TABLE table_source;
|
||||
DROP TABLE table_countries;
|
||||
DROP TABLE table_stations;
|
||||
DROP TABLE table_target;
|
||||
DROP TABLE table_target2;
|
||||
DROP TABLE table_target3;
|
||||
DROP VIEW view_target2;
|
||||
DROP VIEW view_target3;
|
||||
DROP USER user20989@localhost;
|
||||
|
||||
disconnect root;
|
||||
|
||||
connection default;
|
||||
|
||||
DROP DATABASE meow;
|
||||
|
@ -520,6 +520,8 @@ select * from v1a join v1b on t1.b = t2.b;
|
||||
#
|
||||
# Bug #17523 natural join and information_schema
|
||||
#
|
||||
# We mask out the Privileges column because it differs with embedded server
|
||||
--replace_column 31 #
|
||||
select * from information_schema.statistics join information_schema.columns
|
||||
using(table_name,column_name) where table_name='user';
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
-- source include/not_embedded.inc
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
@ -498,7 +498,7 @@ insert into t1 values (1),(2),(3),(4),(5),(6);
|
||||
insert into t2 values (1,1),(2,1);
|
||||
lock tables t1 read local, t2 read local;
|
||||
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
insert into t2 values(2,0);
|
||||
disconnect root;
|
||||
connection default;
|
||||
|
@ -1,3 +1,6 @@
|
||||
# Can't run test of external client with embedded server
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# Only run test if "mysql_upgrade" is found
|
||||
--require r/have_mysql_upgrade.result
|
||||
--disable_query_log
|
||||
|
@ -1,3 +1,5 @@
|
||||
# Embedded server doesn't support external clients
|
||||
--source include/not_embedded.inc
|
||||
#
|
||||
# Test "mysqladmin ping"
|
||||
#
|
||||
|
@ -83,6 +83,14 @@ delete from t2 where a = 1;
|
||||
insert into t2 values(8, 2, 3);
|
||||
select * from t2 order by a;
|
||||
|
||||
# Bug #24818 CREATE UNIQUE INDEX (...) USING HASH on a NDB table crashes mysqld
|
||||
create unique index bi using hash on t2(b);
|
||||
-- error 1062
|
||||
insert into t2 values(9, 3, 1);
|
||||
alter table t2 drop index bi;
|
||||
insert into t2 values(9, 3, 1);
|
||||
select * from t2 order by a;
|
||||
|
||||
drop table t2;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
|
@ -81,12 +81,12 @@ drop table t1, t2, t3, t11, t21;
|
||||
#
|
||||
# do not use QC if tables locked (BUG#12385)
|
||||
#
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection root;
|
||||
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
|
||||
MyISAM;
|
||||
LOCK TABLE t1 READ LOCAL;
|
||||
connect (root2,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connect (root2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection root2;
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
connection root;
|
||||
|
@ -1,5 +1,5 @@
|
||||
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
connection master;
|
||||
reset master;
|
||||
show master status;
|
||||
|
@ -1,5 +1,5 @@
|
||||
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
connection master;
|
||||
reset master;
|
||||
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
|
||||
|
@ -16,7 +16,7 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
--enable_warnings
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
# Create empty file
|
||||
write_file $MYSQLTEST_VARDIR/slave-data/master.info;
|
||||
EOF
|
||||
|
@ -1,3 +1,6 @@
|
||||
# embedded server causes different stat
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# PS causes different statistics
|
||||
--disable_ps_protocol
|
||||
|
||||
|
@ -1146,6 +1146,7 @@ write_file $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
|
||||
dummy
|
||||
EOF
|
||||
chmod 0000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~;
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--error 1
|
||||
rename table t1 to t2;
|
||||
# 't1' should be still there and triggers should work correctly
|
||||
|
Reference in New Issue
Block a user