Merge 5.1-bugteam into main.

This commit is contained in:
Davi Arnaut 2009-02-09 19:41:02 -02:00
commit 5f119f2825
96 changed files with 1236 additions and 714 deletions

View file

@ -2048,7 +2048,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio pthread_setschedprio \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
@ -2071,6 +2071,15 @@ case "$target" in
;;
esac
case "$mysql_cv_sys_os" in
OS400) # i5/OS (OS/400) emits a SIGILL (Function not implemented) when
# unsupported priority values are passed to pthread_setschedprio.
# Since the only supported value is 1, treat it as inexistent.
;;
*) AC_CHECK_FUNCS(pthread_setschedprio)
;;
esac
# Check that isinf() is available in math.h and can be used in both C and C++
# code
AC_MSG_CHECKING(for isinf in <math.h>)

View file

@ -724,7 +724,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define UNSINT32 /* unsigned int32 */
/* General constants */
#define SC_MAXWIDTH 256 /* Max width of screen (for error messages) */
#define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */

View file

@ -39,8 +39,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */
#define NRERRBUFFS (2) /* Buffers for parameters */
#define MY_FILE_ERROR ((size_t) -1)
/* General bitmaps for my_func's */
@ -208,7 +206,6 @@ extern void my_large_free(uchar * ptr, myf my_flags);
extern int errno; /* declare errno */
#endif
#endif /* #ifndef errno */
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */
extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */

View file

@ -159,7 +159,8 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
void thr_print_locks(void); /* For debugging */
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type);
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type);
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);

View file

@ -419,7 +419,7 @@ connection master;
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
--echo
--echo ** Delete from Master **

View file

@ -0,0 +1,21 @@
# include/count_sessions.inc
#
# SUMMARY
#
# Stores the number of current sessions in $count_sessions.
#
#
# USAGE
#
# Please look into include/wait_until_count_sessions.inc
# for examples of typical usage.
#
#
# EXAMPLE
# backup.test, grant3.test
#
#
# Created: 2009-01-14 mleich
#
let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);

View file

@ -108,7 +108,6 @@ execute stmt1 using @arg00, @arg01;
select a,b from t1 where a=@arg00;
set @arg00=NULL;
set @arg01=2;
--error 1048
execute stmt1 using @arg00, @arg01;
select a,b from t1 order by a;
set @arg00=0;

View file

@ -0,0 +1,112 @@
# include/wait_until_count_sessions.inc
#
# SUMMARY
#
# Waits until the passed number ($count_sessions) of concurrent sessions was
# observed via
# SHOW STATUS LIKE 'Threads_connected'
# or the operation times out.
# Note: Starting with 5.1 we could also use
# SELECT COUNT(*) FROM information_schema.processlist
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
# runs in all versions 5.0+
#
#
# USAGE
#
# let $count_sessions= 3;
# --source include/wait_until_count_sessions.inc
#
# OR typical example of a test which uses more than one session
# Such a test could harm successing tests if there is no server shutdown
# and start between.cw
#
# If the testing box is slow than the disconnect of sessions belonging to
# the current test might happen when the successing test gets executed.
# This means the successing test might see activities like unexpected
# rows within the general log or the PROCESSLIST.
# Example from bug http://bugs.mysql.com/bug.php?id=40377
# --- bzr_mysql-6.0-rpl/.../r/log_state.result
# +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
# @@ -25,6 +25,7 @@
# event_time user_host ... command_type argument
# TIMESTAMP USER_HOST ... Query create table t1(f1 int)
# TIMESTAMP USER_HOST ... Query select * from mysql.general_log
# +TIMESTAMP USER_HOST ... Quit
# ....
#
# What to do?
# -----------
# <start of test>
# # Determine initial number of connections (set $count_sessions)
# --source include/count_sessions.inc
# ...
# connect (con1,.....)
# ...
# connection default;
# ...
# disconnect con1;
# ...
# # Wait until we have reached the initial number of connections
# # or more than the sleep time above (10 seconds) has passed.
# # $count_sessions
# --source include/wait_until_count_sessions.inc
# <end of test>
#
# Important note about tests with unfortunate (= not cooperative
# to successing tests) architecture:
# connection con1;
# send SELECT ..., sleep(10)
# connection default;
# ...
# disconnect con1;
# <end of test>
# should be fixed by
# connection con1;
# send SELECT ..., sleep(10)
# connection default;
# ...
# connect con1;
# reap;
# connection default;
# disconnect con1;
# <end of test>
# and not only by appending include/wait_until_count_sessions.inc etc.
#
#
# EXAMPLE
#
# backup.test, grant3.test
#
#
# Created: 2009-01-14 mleich
#
let $wait_counter= 50;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
while ($wait_counter)
{
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
let $success= `SELECT $current_sessions = $count_sessions`;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
--echo # Timeout in wait_until_count_sessions.inc
--echo # Number of sessions expected: $count_sessions found: $current_sessions
}

View file

@ -237,12 +237,19 @@ int main(int argc, const char** argv )
/*
Create the process suspended to make sure it's assigned to the
Job before it creates any process of it's own
Allow the new process to break away from any job that this
process is part of so that it can be assigned to the new JobObject
we just created. This is safe since the new JobObject is created with
the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag, making sure it will be
terminated when the last handle to it is closed(which is owned by
this process).
*/
if (CreateProcess(NULL, (LPSTR)child_args,
NULL,
NULL,
TRUE, /* inherit handles */
CREATE_SUSPENDED,
CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB,
NULL,
NULL,
&si,

View file

@ -28,7 +28,17 @@ sub msg {
# print "### unique($$) - ", join(" ", @_), "\n";
}
my $file= "/tmp/mysql-test-ports";
my $file;
if(!IS_WINDOWS)
{
$file= "/tmp/mysql-test-ports";
}
else
{
$file= $ENV{'TEMP'}."/mysql-test-ports";
}
my %mtr_unique_ids;

View file

@ -132,7 +132,7 @@ our @opt_extra_mysqld_opt;
my $opt_compress;
my $opt_ssl;
my $opt_skip_ssl = 1; # Until bug#42366 has been fixed
my $opt_skip_ssl;
my $opt_ssl_supported;
my $opt_ps_protocol;
my $opt_sp_protocol;
@ -1528,8 +1528,8 @@ sub mysql_fix_arguments () {
mtr_init_args(\$args);
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
mtr_add_arg($args, "--basedir=", $basedir);
mtr_add_arg($args, "--bindir=", $path_client_bindir);
mtr_add_arg($args, "--basedir=%s", $basedir);
mtr_add_arg($args, "--bindir=%s", $path_client_bindir);
mtr_add_arg($args, "--verbose");
return mtr_args2str($exe, @$args);
}

View file

@ -231,7 +231,8 @@ a b
204 7
delete from t1 where a=0;
update t1 set a=NULL where b=6;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
update t1 set a=300 where b=7;
SET SQL_MODE='';
insert into t1(a,b)values(NULL,8);
@ -246,7 +247,7 @@ a b
1 1
200 2
201 4
203 6
0 6
300 7
301 8
400 9
@ -262,7 +263,6 @@ a b
1 1
200 2
201 4
203 6
300 7
301 8
400 9
@ -273,20 +273,20 @@ a b
405 14
delete from t1 where a=0;
update t1 set a=NULL where b=13;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
update t1 set a=500 where b=14;
select * from t1 order by b;
a b
1 1
200 2
201 4
203 6
300 7
301 8
400 9
401 10
402 11
404 13
0 13
500 14
drop table t1;
create table t1 (a bigint);

View file

@ -46,8 +46,9 @@ SELECT * FROM t1;
a b
0 new_value
UPDATE t1 set b = NULL where b = 'new_value';
ERROR 23000: Column 'b' cannot be null
Warnings:
Warning 1048 Column 'b' cannot be null
SELECT * FROM t1;
a b
0 new_value
0
DROP TABLE t1;

View file

@ -284,4 +284,30 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
DROP TABLE t1,t2;
set @old_delayed_updates = @@global.low_priority_updates;
set global low_priority_updates = 1;
select @@global.low_priority_updates;
@@global.low_priority_updates
1
drop table if exists t1;
create table t1 (a int, b int);
insert into t1 values (1,1);
lock table t1 read;
connection: update
insert delayed into t1 values (2,2);;
connection: select
select * from t1;
a b
1 1
connection: default
select * from t1;
a b
1 1
unlock tables;
select * from t1;
a b
1 1
2 2
drop table t1;
set global low_priority_updates = @old_delayed_updates;
End of 5.1 tests

View file

@ -324,6 +324,11 @@ select @my_uuid_date - @my_uuid_synthetic;
@my_uuid_date - @my_uuid_synthetic
0
set @@session.time_zone=@save_tz;
CREATE TABLE t1 (a DATE);
SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
_binary'2009-01-09' COLLATE 'binary');
a
DROP TABLE t1;
End of 5.0 tests
select connection_id() > 0;
connection_id() > 0

View file

@ -268,3 +268,17 @@ timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
SELECT CAST(time('-73:42:12') AS DECIMAL);
CAST(time('-73:42:12') AS DECIMAL)
-734212
SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
1Eq 1NEq1 1NEq2 2Eq 2NEq1 2NEq2 3Eq 3NEq1 3NEq2 Time0 Time00 Literal0000 TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')) TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'))
1 0 0 1 0 0 1 0 0 00:00:00 00:00:00 00:00:00 00:59:00 -00:59:00

View file

@ -367,20 +367,20 @@ drop database TESTDB;
flush privileges;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost;
grant execute on * to `a@`@localhost;
create table t2 (s1 int);
insert into t2 values (1);
drop function if exists f2;
create function f2 () returns int
begin declare v int; select s1 from t2 into v; return v; end//
select f2();
GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
GRANT EXECUTE ON * TO `a@`@localhost;
CREATE TABLE t2 (s1 INT);
INSERT INTO t2 VALUES (1);
DROP FUNCTION IF EXISTS f2;
CREATE FUNCTION f2 () RETURNS INT
BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
SELECT f2();
f2()
1
drop function f2;
drop table t2;
DROP FUNCTION f2;
DROP TABLE t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
DROP USER `a@`@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database if exists mysqltest_1;
drop database if exists mysqltest_2;
@ -438,6 +438,7 @@ SELECT * FROM t2;
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
SELECT * FROM t1 JOIN t2 USING (b);
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
DROP DATABASE db1;

View file

@ -1,3 +1,3 @@
load_file(concat(@tmpdir,"/outfile.test"))
load_file(concat(@tmpdir,'/outfile.test'))
Outfile OK

View file

@ -0,0 +1,9 @@
show variables like 'ignore_builtin_innodb';
Variable_name Value
ignore_builtin_innodb ON
select PLUGIN_NAME from information_schema.plugins
where PLUGIN_NAME = "InnoDb";
PLUGIN_NAME
select ENGINE from information_schema.engines
where ENGINE = "InnoDB";
ENGINE

View file

@ -1,8 +1,8 @@
drop table if exists t1;
create table t1(a int) engine=innodb;
lock tables t1 write;
insert into t1 values(10);
select * from t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT) ENGINE=innodb;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES(10);
SELECT * FROM t1;
a
10
drop table t1;
DROP TABLE t1;

View file

@ -988,6 +988,17 @@ m1 CREATE TABLE `m1` (
`a` int(11) DEFAULT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, m1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a VARCHAR(10));
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM t1;
a
SELECT * FROM m1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
SELECT * FROM m2;
a
DROP TABLE t1, t2, m1, m2;
End of 5.0 tests
create table t1 (c1 int, index(c1));
create table t2 (c1 int, index(c1)) engine=merge union=(t1);

View file

@ -1,6 +1,6 @@
Bug#37938 - Test "mysqldump" lacks various insert statements
Turn off concurrent inserts to avoid random errors
NOTE: We reset the variable back to saved value at the end of test
# Bug#37938 Test "mysqldump" lacks various insert statements
# Turn off concurrent inserts to avoid random errors
# NOTE: We reset the variable back to saved value at the end of test
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT = 0;
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
@ -8,7 +8,7 @@ drop database if exists mysqldump_test_db;
drop database if exists db1;
drop database if exists db2;
drop view if exists v1, v2, v3;
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
INSERT INTO t1 VALUES (1), (2);
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@ -29,7 +29,7 @@ INSERT INTO t1 VALUES (1), (2);
</mysqldump>
DROP TABLE t1;
#
# Bug #2005
# Bug#2005 Long decimal comparison bug.
#
CREATE TABLE t1 (a decimal(64, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
@ -43,7 +43,7 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
DROP TABLE t1;
#
# Bug #2055
# Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
#
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES ('-9e999999');
@ -58,7 +58,7 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES (RES);
DROP TABLE t1;
#
# Bug #3361 mysqldump quotes DECIMAL values inconsistently
# Bug#3361 mysqldump quotes DECIMAL values inconsistently
#
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
INSERT INTO t1 VALUES (1.2345, 2.3456);
@ -170,7 +170,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
</mysqldump>
DROP TABLE t1;
#
# Bug #1707
# Bug#1707 mysqldump -X does't quote field and table names
#
CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2");
@ -192,8 +192,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
</mysqldump>
DROP TABLE t1;
#
# Bug #1994
# Bug #4261
# Bug#1994 mysqldump does not correctly dump UCS2 data
# Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
#
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
@ -234,7 +234,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# Bug #2634
# Bug#2634 mysqldump in --compatible=mysql4
#
CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
@ -292,7 +292,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
# Bug#2592 mysqldump doesn't quote "tricky" names correctly
#
create table ```a` (i int);
SET @saved_cs_client = @@character_set_client;
@ -303,7 +303,7 @@ CREATE TABLE ```a` (
SET character_set_client = @saved_cs_client;
drop table ```a`;
#
# Bug #2591 "mysqldump quotes names inconsistently"
# Bug#2591 mysqldump quotes names inconsistently
#
create table t1(a int);
@ -426,7 +426,7 @@ UNLOCK TABLES;
set global sql_mode='';
drop table t1;
#
# Bug #2705 'mysqldump --tab extra output'
# Bug#2705 mysqldump --tab extra output
#
create table t1(a int);
insert into t1 values (1),(2),(3);
@ -460,7 +460,7 @@ SET character_set_client = @saved_cs_client;
3
drop table t1;
#
# Bug #6101: create database problem
# Bug#6101 create database problem
#
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
@ -515,7 +515,7 @@ USE `mysqldump_test_db`;
drop database mysqldump_test_db;
#
# Bug #7020
# Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
# Check that we don't dump in UTF8 in compatible mode by default,
# but use the default compiled values, or the values given in
# --default-character-set=xxx. However, we should dump in UTF8
@ -557,8 +557,8 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
#
# Bug#8063: make test mysqldump [ fail ]
# We cannot tes this command because its output depends
# Bug#8063 make test mysqldump [ fail ]
# We cannot test this command because its output depends
# on --default-character-set incompiled into "mysqldump" program.
# If the future we can move this command into a separate test with
# checking that "mysqldump" is compiled with "latin1"
@ -643,7 +643,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# WL #2319: Exclude Tables from dump
# WL#2319 Exclude Tables from dump
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
@ -686,7 +686,7 @@ UNLOCK TABLES;
DROP TABLE t1;
DROP TABLE t2;
#
# Bug #8830
# Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
#
CREATE TABLE t1 (`b` blob);
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
@ -728,7 +728,7 @@ DROP TABLE t1;
#
# Test for --insert-ignore
#
CREATE TABLE t1 (a int);
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
@ -799,7 +799,7 @@ INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
DROP TABLE t1;
#
# Bug #10286: mysqldump -c crashes on table that has many fields with long
# Bug#10286 mysqldump -c crashes on table that has many fields with long
# names
#
create table t1 (
@ -1545,7 +1545,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
# Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
#
CREATE DATABASE mysqldump_test_db;
USE mysqldump_test_db;
@ -1650,7 +1650,7 @@ DROP DATABASE mysqldump_test_db;
#
# Testing with tables and databases that don't exists
# or contains illegal characters
# (Bug #9358 mysqldump crashes if tablename starts with \)
# (Bug#9358 mysqldump crashes if tablename starts with \)
#
create database mysqldump_test_db;
use mysqldump_test_db;
@ -1679,7 +1679,7 @@ drop table t1, t2, t3;
drop database mysqldump_test_db;
use test;
#
# Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
# Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
#
create table t1 (a int(10));
create table t2 (pk int primary key auto_increment,
@ -1738,7 +1738,7 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
</mysqldump>
drop table t1, t2;
#
# BUG #12123
# Bug#12123 mysqldump --tab results in text file which can't be imported
#
create table t1 (a text character set utf8, b text character set latin1);
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
@ -1751,11 +1751,11 @@ a b
Osnabrück Köln
drop table t1;
#
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
# Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--fields-optionally-enclosed-by="
#
# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
# Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
#
create table `t1` (
t1_name varchar(255) default null,
@ -1795,7 +1795,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM AUTO_INCREMENT=1003 DEFAULT CHARSET=latin1
drop table `t1`;
#
# Bug #18536: wrong table order
# Bug#18536 wrong table order
#
create table t1(a int);
create table t2(a int);
@ -1844,7 +1844,7 @@ SET character_set_client = @saved_cs_client;
drop table t1, t2, t3;
#
# Bug #21288: mysqldump segmentation fault when using --where
# Bug#21288 mysqldump segmentation fault when using --where
#
create table t1 (a int);
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
@ -1880,7 +1880,7 @@ SET character_set_client = @saved_cs_client;
drop table t1;
#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
# Bug#13926 --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
@ -1959,7 +1959,7 @@ UNLOCK TABLES;
DROP TABLE `t1`;
End of 4.1 tests
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
# Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database db1;
use db1;
@ -2036,7 +2036,7 @@ drop view v2;
drop database db1;
use test;
#
# Bug 10713 mysqldump includes database in create view and referenced tables
# Bug#10713 mysqldump includes database in create view and referenced tables
#
create database db2;
use db2;
@ -2067,9 +2067,6 @@ a b
drop table t1, t2;
drop database db1;
use test;
#
# dump of view
#
create table t1(a int);
create view v1 as select * from t1;
@ -2130,7 +2127,7 @@ SET character_set_client = @saved_cs_client;
drop view v1;
drop table t1;
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
# Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
#
create database mysqldump_test_db;
use mysqldump_test_db;
@ -2207,7 +2204,7 @@ drop view v2;
drop database mysqldump_test_db;
use test;
#
# Bug #9756
# Bug#9756 mysql client failing on dumps containing certain \ sequences
#
CREATE TABLE t1 (a char(10));
INSERT INTO t1 VALUES ('\'');
@ -2247,7 +2244,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# Bug #10927 mysqldump: Can't reload dump with view that consist of other view
# Bug#10927 mysqldump: Can't reload dump with view that consist of other view
#
create table t1(a int, b int, c varchar(30));
insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three");
@ -2620,12 +2617,14 @@ end if;
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1, t2;
#
# Bugs #9136, #12917: problems with --defaults-extra-file option
# Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
# Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
# (Problems with --defaults-extra-file option)
#
--port=1234
--port=1234
#
# Test of fix to BUG 12597
# Test of fix to Bug#12597 mysqldump dumps triggers wrongly
#
DROP TABLE IF EXISTS `test1`;
Warnings:
@ -2659,7 +2658,7 @@ DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test2;
#
# BUG#9056 - mysqldump does not dump routines
# Bug#9056 mysqldump does not dump routines
#
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS bug9056_func1;
@ -2819,7 +2818,7 @@ DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
drop table t1;
#
# BUG# 13052 - mysqldump timestamp reloads broken
# Bug#13052 mysqldump timestamp reloads broken
#
drop table if exists t1;
create table t1 (`d` timestamp, unique (`d`));
@ -2914,7 +2913,7 @@ drop table t1;
set global time_zone=default;
set time_zone=default;
#
# Test of fix to BUG 13146 - ansi quotes break loading of triggers
# Test of fix to Bug#13146 ansi quotes break loading of triggers
#
DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t2 test`;
@ -2993,7 +2992,7 @@ DROP TRIGGER `test trig`;
DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
#
# BUG# 12838 mysqldump -x with views exits with error
# Bug#12838 mysqldump -x with views exits with error
#
drop table if exists t1;
create table t1 (a int, b varchar(32), c varchar(32));
@ -3127,7 +3126,7 @@ drop view v0;
drop view v1;
drop table t1;
#
# BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
# Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
# for tables with trigger created in the IGNORE_SPACE sql mode.
#
SET @old_sql_mode = @@SQL_MODE;
@ -3198,7 +3197,7 @@ DELIMITER ;
DROP TRIGGER tr1;
DROP TABLE t1;
#
# Bug #13318: Bad result with empty field and --hex-blob
# Bug#13318 Bad result with empty field and --hex-blob
#
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
@ -3274,7 +3273,7 @@ UNLOCK TABLES;
drop table t1;
#
# Bug 14871 Invalid view dump output
# Bug#14871 Invalid view dump output
#
create table t1 (a int);
insert into t1 values (289), (298), (234), (456), (789);
@ -3303,7 +3302,7 @@ a
drop table t1;
drop view v1, v2, v3, v4, v5;
#
# Bug #16878 dump of trigger
# Bug#16878 dump of trigger
#
create table t1 (a int, created datetime);
create table t2 (b int, created datetime);
@ -3371,7 +3370,7 @@ drop view v2;
drop table t;
#
# Bug#14857 Reading dump files with single statement stored routines fails.
# fixed by patch for bug#16878
# fixed by patch for Bug#16878
#
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
return 42 */|
@ -3388,7 +3387,7 @@ select 42 latin1 latin1_swedish_ci latin1_swedish_ci
drop function f;
drop procedure p;
#
# Bug #17371 Unable to dump a schema with invalid views
# Bug#17371 Unable to dump a schema with invalid views
#
create table t1 ( id serial );
create view v1 as select * from t1;
@ -3399,7 +3398,7 @@ mysqldump {
} mysqldump
drop view v1;
# BUG#17201 Spurious 'DROP DATABASE' in output,
# Bug#17201 Spurious 'DROP DATABASE' in output,
# also confusion between tables and views.
# Example code from Markus Popp
create database mysqldump_test_db;
@ -3478,7 +3477,7 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
#
# Bug21014 Segmentation fault of mysqldump on view
# Bug#21014 Segmentation fault of mysqldump on view
#
create database mysqldump_tables;
use mysqldump_tables;
@ -3530,7 +3529,7 @@ drop database mysqldump_views;
drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
#
# Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
# Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
#
create database mysqldump_dba;
use mysqldump_dba;
@ -3579,10 +3578,10 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
#
# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
# Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
# information_schema database.
#
# Bug #21424 mysqldump failing to export/import views
# Bug#21424 mysqldump failing to export/import views
#
create database mysqldump_myDB;
use mysqldump_myDB;
@ -3602,7 +3601,7 @@ revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
flush privileges;
# Bug #21424 continues from here.
# Bug#21424 continues from here.
# Restore. Flush Privileges test ends.
#
use mysqldump_myDB;
@ -3621,7 +3620,7 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
use test;
#
# Bug #19745: mysqldump --xml produces invalid xml
# Bug#19745 mysqldump --xml produces invalid xml
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f1 int(10), data MEDIUMBLOB);
@ -3643,15 +3642,15 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
</mysqldump>
DROP TABLE t1;
#
# Bug#26346: stack + buffer overrun in mysqldump
# Bug#26346 stack + buffer overrun in mysqldump
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@ -3706,7 +3705,7 @@ UNLOCK TABLES;
DROP TABLE t1, t2, t3;
#
# Bug #23491: MySQLDump prefix function call in a view by database name
# Bug#23491 MySQLDump prefix function call in a view by database name
#
create database bug23491_original;
create database bug23491_restore;
@ -3729,10 +3728,10 @@ drop database bug23491_original;
drop database bug23491_restore;
use test;
#
# Bug 27293: mysqldump crashes when dumping routines
# Bug#27293 mysqldump crashes when dumping routines
# defined by a different user
#
# Bug #22761: mysqldump reports no errors when using
# Bug#22761 mysqldump reports no errors when using
# --routines without mysql.proc privileges
#
create database mysqldump_test_db;
@ -3764,7 +3763,7 @@ drop user user1;
drop user user2;
drop database mysqldump_test_db;
#
# Bug #28522: buffer overrun by '\0' byte using --hex-blob.
# Bug#28522 buffer overrun by '\0' byte using --hex-blob.
#
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
@ -3778,7 +3777,7 @@ SET character_set_client = @saved_cs_client;
INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
DROP TABLE t1;
#
# Bug #28524: mysqldump --skip-add-drop-table is not
# Bug#28524 mysqldump --skip-add-drop-table is not
# compatible with views
#
CREATE VIEW v1 AS SELECT 1;
@ -3788,7 +3787,7 @@ SELECT * FROM v1;
1
DROP VIEW v1;
#
# Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
# Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
# the SQL_MODE variable after the dumping of triggers.
#
CREATE TABLE t1 (c1 INT);
@ -3810,7 +3809,7 @@ c1
2
DROP TABLE t1,t2;
#
# Bug#29815: new option for suppressing last line of mysqldump:
# Bug#29815 new option for suppressing last line of mysqldump:
# "Dump completed on"
#
# --skip-dump-date:
@ -3876,7 +3875,7 @@ UNLOCK TABLES;
DROP TABLE t1;
#
# BUG# 16853: mysqldump doesn't show events
# Bug#16853 mysqldump doesn't show events
#
create database first;
use first;
@ -3916,7 +3915,7 @@ drop database third;
set time_zone = 'SYSTEM';
use test;
#
# BUG#17201 Spurious 'DROP DATABASE' in output,
# Bug#17201 Spurious 'DROP DATABASE' in output,
# also confusion between tables and views.
# Example code from Markus Popp
#
@ -3996,7 +3995,7 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
#
# Bug #30027: mysqldump does not dump views properly.
# Bug#30027 mysqldump does not dump views properly.
#
# Cleanup.
@ -4029,7 +4028,7 @@ set names latin1;
# Cleanup.
DROP DATABASE mysqldump_test_db;
#
# BUG#29938: wrong behavior of mysqldump --skip-events
# Bug#29938 wrong behavior of mysqldump --skip-events
# with --all-databases
#
TRUNCATE mysql.event;
@ -4062,7 +4061,7 @@ drop database `test-database`;
use test;
# -----------------------------------------------------------------
# -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1.
# -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1.
# -----------------------------------------------------------------
DROP DATABASE IF EXISTS mysqldump_test_db;

View file

@ -93,9 +93,11 @@ INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=1/NULL;
ERROR 23000: Column 'd' cannot be null
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL;
ERROR 23000: Column 'd' cannot be null
Warnings:
Warning 1048 Column 'd' cannot be null
INSERT INTO t1 (a) values (null);
ERROR 23000: Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null);
@ -130,7 +132,7 @@ Warning 1048 Column 'd' cannot be null
Warning 1048 Column 'd' cannot be null
select * from t1;
a b c d
0 0000-00-00 00:00:00 2003
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0
0 0000-00-00 00:00:00 0

Binary file not shown.

View file

@ -1303,11 +1303,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;

View file

@ -1286,11 +1286,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;

View file

@ -1287,11 +1287,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;

View file

@ -1329,11 +1329,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;
@ -4350,11 +4351,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;

View file

@ -98,7 +98,8 @@ Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'c' at row 2
alter table t1 add d char(2);
update t1 set a=NULL where a=10;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
update t1 set c='mysql ab' where c='test';
Warnings:
Warning 1265 Data truncated for column 'c' at row 4

View file

@ -1053,4 +1053,15 @@ ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml')
NULL
Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 17: STRING unexpected ('>' wanted)'
set @x=10;
select extractvalue('<a></a>','$@x/a');
ERROR HY000: XPATH syntax error: '/a'
select extractvalue('<a></a>','round(123.4)/a');
ERROR HY000: XPATH syntax error: '/a'
select extractvalue('<a></a>','1/a');
ERROR HY000: XPATH syntax error: '/a'
select extractvalue('<a></a>','"b"/a');
ERROR HY000: XPATH syntax error: '/a'
select extractvalue('<a></a>','(1)/a');
ERROR HY000: XPATH syntax error: '/a'
End of 5.1 tests

View file

@ -220,3 +220,10 @@ Warning 1592 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
INSERT INTO t1 VALUES ('a','b');
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
DROP TABLE t1;

View file

@ -257,3 +257,17 @@ delimiter ;|
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t1;
#
# Bug#42634: % character in query can cause mysqld signal 11 segfault
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
INSERT INTO t1 VALUES ('a','b');
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
DROP TABLE t1;

View file

@ -187,7 +187,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
ERROR 23000: Column 'f136' cannot be null
Warnings:
Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3

View file

@ -188,7 +188,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
ERROR 23000: Column 'f136' cannot be null
Warnings:
Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3

View file

@ -188,7 +188,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
ERROR 23000: Column 'f136' cannot be null
Warnings:
Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3

View file

@ -187,7 +187,8 @@ a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
0 0 0 0 0 0
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
ERROR 23000: Column 'f136' cannot be null
Warnings:
Warning 1048 Column 'f136' cannot be null
Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3

View file

@ -183,7 +183,6 @@ let $message= Testcase 3.5.9.4:;
@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
--enable_query_log
--error ER_BAD_NULL_ERROR
Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
where f122='Test 3.5.9.4';

View file

@ -1286,11 +1286,12 @@ a b
set @arg00=NULL;
set @arg01=2;
execute stmt1 using @arg00, @arg01;
ERROR 23000: Column 'a' cannot be null
Warnings:
Warning 1048 Column 'a' cannot be null
select a,b from t1 order by a;
a b
0 two
1 one
2 two
3 three
4 four
set @arg00=0;

View file

@ -50,12 +50,7 @@ if (!$skip_update)
UPDATE t1 SET c1 = 40 WHERE c1 = 50;
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AND TABLE_NAME='t1';
-- error 0, ER_BAD_NULL_ERROR
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
if (!$mysql_errno)
{
echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
}
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
}
@ -203,12 +198,7 @@ if (!$skip_update)
UPDATE t1 SET c1 = 140 WHERE c1 = 150;
SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AND TABLE_NAME='t1';
-- error 0, ER_BAD_NULL_ERROR
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
if (!$mysql_errno)
{
echo # ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY;
}
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
}

View file

@ -43,7 +43,6 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
1
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
@ -192,7 +191,6 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
1
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
# ERROR (only OK if Blackhole) should give ER_DUP_KEY or ER_DUP_ENTRY
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;

View file

@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
31
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
10
@ -215,12 +217,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
141
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
9

View file

@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
10
@ -214,12 +216,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
9

View file

@ -42,12 +42,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
10
@ -214,12 +216,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
9

View file

@ -43,12 +43,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
52
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
10
@ -215,12 +217,14 @@ SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
AUTO_INCREMENT
152
UPDATE t1 SET c1 = NULL WHERE c1 = 4;
Warnings:
Warning 1048 Column 'c1' cannot be null
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
0
2
4
5
6
9

View file

@ -454,7 +454,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@ -1593,7 +1595,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@ -2732,7 +2736,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **

View file

@ -454,7 +454,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@ -1593,7 +1595,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **
@ -2732,7 +2736,9 @@ f1 f2 f3 f4
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
Warnings:
Warning 1048 Column 'f3' cannot be null
** Delete from Master **

View file

@ -50,7 +50,7 @@ kill @id;
drop table t2,t3;
insert into t4 values (3),(4);
connection master;
--error 0,1053,2013,1048
--error 0,1053,2013
reap;
connection master1;
save_master_pos;

View file

@ -10,7 +10,4 @@
#
##############################################################################
rpl_ndb_circular : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
rpl_ndb_circular_simplex : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open

View file

@ -149,7 +149,6 @@ delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
delete from t1 where a=0;
--error 1048
update t1 set a=NULL where b=6;
update t1 set a=300 where b=7;
SET SQL_MODE='';
@ -165,7 +164,6 @@ delete from t1 where a=0;
update t1 set a=0 where b=12;
select * from t1 order by b;
delete from t1 where a=0;
--error 1048
update t1 set a=NULL where b=13;
update t1 set a=500 where b=14;
select * from t1 order by b;

View file

@ -93,7 +93,6 @@ SELECT * FROM t1;
UPDATE t1 set b = 'new_value' where a = 0;
--enable_warnings
SELECT * FROM t1;
--error ER_BAD_NULL_ERROR
UPDATE t1 set b = NULL where b = 'new_value';
SELECT * FROM t1;

View file

@ -285,4 +285,47 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
DROP TABLE t1,t2;
#
# Bug#40536: SELECT is blocked by INSERT DELAYED waiting on upgrading lock,
# even with low_priority_updates
#
set @old_delayed_updates = @@global.low_priority_updates;
set global low_priority_updates = 1;
select @@global.low_priority_updates;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int, b int);
insert into t1 values (1,1);
lock table t1 read;
connect (update,localhost,root,,);
connection update;
--echo connection: update
--send insert delayed into t1 values (2,2);
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where command = "Delayed insert" and state = "upgrading lock";
--source include/wait_condition.inc
connect (select,localhost,root,,);
--echo connection: select
select * from t1;
connection default;
--echo connection: default
select * from t1;
connection default;
disconnect update;
disconnect select;
unlock tables;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where command = "Delayed insert" and state = "Waiting for INSERT";
--source include/wait_condition.inc
select * from t1;
drop table t1;
set global low_priority_updates = @old_delayed_updates;
--echo End of 5.1 tests

View file

@ -445,6 +445,15 @@ select @my_uuid_date - @my_uuid_synthetic;
set @@session.time_zone=@save_tz;
#
# Bug#42014: Crash, name_const with collate
#
CREATE TABLE t1 (a DATE);
SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
_binary'2009-01-09' COLLATE 'binary');
DROP TABLE t1;
--echo End of 5.0 tests
#

View file

@ -151,4 +151,22 @@ select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
SELECT CAST(time('-73:42:12') AS DECIMAL);
#
# Bug#42525 - TIMEDIFF function
#
SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1NEq2,
TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))= '00:00:00' AS 2Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))= '00:00:00' AS 2NEq2,
TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME(0) AS 3Eq,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00'))=TIME(0) AS 3NEq1,
TIMEDIFF(TIME('18:00:00'),TIME('17:00:00'))=TIME(0) AS 3NEq2,
TIME(0) AS Time0, TIME('00:00:00') AS Time00, '00:00:00' AS Literal0000,
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
# End of 5.0 tests

View file

@ -1,6 +1,10 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
SET NAMES binary;
#
@ -27,7 +31,7 @@ create user mysqltest_2@localhost;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
--error 1132
--error ER_PASSWORD_NOT_ALLOWED
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
disconnect user_a;
connection default;
@ -61,7 +65,7 @@ connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
#
@ -72,7 +76,7 @@ select @@sql_mode;
#
# GRANT without IDENTIFIED BY does not create new users
#
--error 1133
--error ER_PASSWORD_NO_MATCH
grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
with grant option;
@ -80,7 +84,7 @@ disconnect user1;
connection default;
show grants for mysqltest_1@localhost;
show grants for mysqltest_2@localhost;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for mysqltest_3@localhost;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
@ -95,7 +99,7 @@ connect (user2,localhost,mysqltest_1,,);
connection user2;
select current_user();
show databases;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
disconnect user2;
connection default;
@ -106,8 +110,8 @@ drop database mysqltest_1;
flush privileges;
#
# Bug #6173: One can circumvent missing UPDATE privilege if he has SELECT
# and INSERT privilege for table with primary key
# Bug#6173 One can circumvent missing UPDATE privilege if he has SELECT and
# INSERT privilege for table with primary key
#
create database mysqltest;
grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost;
@ -119,10 +123,10 @@ connect (mrbad, localhost, mysqltest_1,,mysqltest);
connection mrbad;
show grants for current_user();
insert into t1 values (1, 'I can''t change it!');
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
update t1 set data='I can change it!' where id = 1;
# This should not be allowed since it too require UPDATE privilege.
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!';
select * from t1;
disconnect mrbad;
@ -138,9 +142,9 @@ create table t1 (a int, b int);
grant select (a) on t1 to mysqltest_1@localhost with grant option;
connect (mrugly, localhost, mysqltest_1,,mysqltest);
connection mrugly;
--error 1143
--error ER_COLUMNACCESS_DENIED_ERROR
grant select (a,b) on t1 to mysqltest_2@localhost;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
grant select on t1 to mysqltest_3@localhost;
disconnect mrugly;
@ -157,7 +161,7 @@ use test;
#
# Bug #15775: "drop user" command does not refresh acl_check_hosts
# Bug#15775 "drop user" command does not refresh acl_check_hosts
#
# Create some test users
@ -188,15 +192,15 @@ disconnect con9;
connection default;
#
# Bug# 16180 - Setting SQL_LOG_OFF without SUPER privilege is silently ignored
# Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored
#
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
connect (con10,localhost,mysqltest_1,,);
connection con10;
--error 1227
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_off = 1;
--error 1227
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_bin = 0;
disconnect con10;
connection default;
@ -217,7 +221,7 @@ create table t2(c1 int, c2 int);
#
# Three forms of CREATE USER
create user 'mysqltest_1';
--error 1396
--error ER_CANNOT_USER
create user 'mysqltest_1';
create user 'mysqltest_2' identified by 'Mysqltest-2';
create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
@ -238,7 +242,7 @@ select host,user,password from mysql.user where user like 'mysqltest_%' order by
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user;
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name;
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
#
# Rename
@ -249,7 +253,7 @@ select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
show grants for 'mysqltest_1';
drop user 'mysqltest_1', 'mysqltest_3';
--error 1396
--error ER_CANNOT_USER
drop user 'mysqltest_1';
#
# Cleanup
@ -258,9 +262,9 @@ drop table t1, t2;
# Add a stray record
insert into mysql.db set user='mysqltest_1', db='%', host='%';
flush privileges;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
--error 1269
--error ER_REVOKE_GRANTS
revoke all privileges, grant option from 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user;
@ -268,7 +272,7 @@ select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,us
# Add a stray record
insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';
flush privileges;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name;
@ -276,7 +280,7 @@ select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1'
# Add a stray record
insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';
flush privileges;
--error 1141
--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name;
@ -286,23 +290,23 @@ create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a';
--error 1396
--error ER_CANNOT_USER
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a';
#
# Let one of multiple users fail
create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
--error 1396
--error ER_CANNOT_USER
create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a';
--error 1396
--error ER_CANNOT_USER
rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
--error 1396
--error ER_CANNOT_USER
drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b';
#
# Obsolete syntax has been dropped
create user 'mysqltest_2' identified by 'Mysqltest-2';
--error 1064
--error ER_PARSE_ERROR
drop user 'mysqltest_2' identified by 'Mysqltest-2';
drop user 'mysqltest_2';
#
@ -312,7 +316,7 @@ show grants for '%@b'@'b';
grant select on mysql.* to '%@b'@'b';
show grants for '%@b'@'b';
rename user '%@b'@'b' to '%@a'@'a';
--error 1141
--error ER_NONEXISTING_GRANT
show grants for '%@b'@'b';
show grants for '%@a'@'a';
drop user '%@a'@'a';
@ -323,7 +327,7 @@ create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
connect (user3,localhost,mysqltest_2,,);
connection user3;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%';
@ -338,7 +342,7 @@ grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;
connect (user4,localhost,mysqltest_3,,);
connection user4;
show grants;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
insert into mysql.user set host='%', user='mysqltest_B';
create user mysqltest_A@'%';
@ -349,7 +353,7 @@ disconnect user4;
connection default;
drop user mysqltest_3@localhost;
#
# Bug #3309: Test IP addresses with netmask
# Bug#3309 Test IP addresses with netmask
set @@sql_mode='';
create database mysqltest_1;
create table mysqltest_1.t1 (i int);
@ -367,7 +371,8 @@ flush privileges;
drop table mysqltest_1.t1;
#
# Bug #12302: 'SET PASSWORD = ...' didn't work if connecting hostname !=
# Bug#12302 Hostname resolution preventing password changes
# 'SET PASSWORD = ...' didn't work if connecting hostname !=
# hostname the current user is authenticated as. Note that a test for this
# was also added to the test above.
#
@ -400,7 +405,7 @@ drop database mysqltest_1;
# But anonymous users can't change their password
connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n5;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
set password = password("changed");
disconnect n5;
connection default;
@ -408,7 +413,7 @@ connection default;
--source include/delete_anonymous_users.inc
# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# Bug#12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# multi-threaded environment". We should be able to execute FLUSH
# PRIVILEGES and SET PASSWORD simultaneously with other account
# management commands (such as GRANT and REVOKE) without causing
@ -471,12 +476,13 @@ connect (con1,localhost,mysqltest_1,password,TESTDB);
# The user mysqltest_1 should only be allowed access to
# database TESTDB, not TEStdb
# On system with "lowercase names" we get error "1007: Can't create db..."
--error 1044, 1007
# On system with "lowercase names" we get error "ER_DB_CREATE_EXISTS: Can't create db..."
--error ER_DBACCESS_DENIED_ERROR, ER_DB_CREATE_EXISTS
create database TEStdb;
# Clean-up
connection default;
disconnect con1;
delete from mysql.user;
delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
insert into mysql.user select * from t1;
@ -485,39 +491,39 @@ drop database TESTDB;
flush privileges;
#
# BUG#13310 incorrect user parsing by SP
# Bug#13310 incorrect user parsing by SP
#
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost;
grant execute on * to `a@`@localhost;
GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
GRANT EXECUTE ON * TO `a@`@localhost;
connect (bug13310,localhost,'a@',,test);
connection bug13310;
create table t2 (s1 int);
insert into t2 values (1);
CREATE TABLE t2 (s1 INT);
INSERT INTO t2 VALUES (1);
--disable_warnings
drop function if exists f2;
DROP FUNCTION IF EXISTS f2;
--enable_warnings
delimiter //;
create function f2 () returns int
begin declare v int; select s1 from t2 into v; return v; end//
CREATE FUNCTION f2 () RETURNS INT
BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
delimiter ;//
select f2();
drop function f2;
drop table t2;
disconnect bug13310;
SELECT f2();
DROP FUNCTION f2;
DROP TABLE t2;
disconnect bug13310;
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost;
DROP USER `a@`@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
#
# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table"
# Bug#25578 CREATE TABLE LIKE does not require any privileges on source table
#
--disable_warnings
drop database if exists mysqltest_1;
@ -551,11 +557,13 @@ create table t1 like mysqltest_2.t1;
# Clean-up
connection default;
disconnect user1;
use test;
drop database mysqltest_1;
drop database mysqltest_2;
drop user mysqltest_u1@localhost;
#
# Bug#18660 Can't grant any privileges on single table in database
# with underscore char
@ -572,7 +580,7 @@ grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
grant select on mysqltest_1.t1 to mysqltest_2@localhost;
connect (con3,localhost,mysqltest_2,,);
connection con3;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
create database mysqltest_3;
use mysqltest_1;
create table t2(f1 int);
@ -580,6 +588,9 @@ select * from t1;
connection default;
drop database mysqltest_1;
connection default;
disconnect con3;
disconnect con18600_1;
revoke all privileges, grant option from mysqltest_1@localhost;
revoke all privileges, grant option from mysqltest_2@localhost;
drop user mysqltest_1@localhost;
@ -587,7 +598,7 @@ drop user mysqltest_2@localhost;
#
# Bug #30468: column level privileges not respected when joining tables
# Bug#30468 column level privileges not respected when joining tables
#
CREATE DATABASE db1;
@ -613,6 +624,7 @@ SELECT * FROM t1 JOIN t2 USING (b);
connection default;
disconnect conn1;
USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
DROP DATABASE db1;
@ -620,3 +632,5 @@ DROP DATABASE db1;
--echo End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -1,6 +1,10 @@
# Can't run with embedded server
# Can't run with embedded server because we use GRANT
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# Test of GRANT commands
SET NAMES binary;
@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_1@localhost with grant option;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
--error 1410
--error ER_CANT_CREATE_USER_WITH_GRANT
grant select on `my\_1`.* to mysqltest_2@localhost;
create user mysqltest_2@localhost;
disconnect user_a;
disconnect master;
connection default;
delete from mysql.user where user like 'mysqltest\_%';
@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
#
# Bug: #19828 Case sensitivity in Grant/Revoke
# Bug#19828 Case sensitivity in Grant/Revoke
#
grant select on test.* to CUser@localhost;
@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST;
#
# Bug#31194: Privilege ordering does not order properly for wildcard values
# Bug#31194 Privilege ordering does not order properly for wildcard values
#
CREATE DATABASE mysqltest_1;
@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1;
--echo End of 5.0 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -0,0 +1 @@
--ignore_builtin_innodb

View file

@ -0,0 +1,8 @@
#
# Bug #42610: Dynamic plugin broken in 5.1.31
#
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";

View file

@ -1,24 +1,33 @@
# This is a test for bug 578
# Test for Bug#578 mysqlimport -l silently fails when binlog-ignore-db is set
-- source include/have_innodb.inc
--source include/have_innodb.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
drop table if exists t1;
create table t1(a int) engine=innodb;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT) ENGINE=innodb;
--enable_warnings
lock tables t1 write;
insert into t1 values(10);
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES(10);
disconnect con1;
connection con2;
# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
# and the other commit when we write to the binlog was not done because of
# binlog-ignore-db
select * from t1;
drop table t1;
SELECT * FROM t1;
DROP TABLE t1;
connection default;
disconnect con2;
# End of 4.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -613,6 +613,19 @@ ALTER TABLE m1 UNION=();
SHOW CREATE TABLE m1;
DROP TABLE t1, m1;
#
# BUG#32047 - 'Spurious' errors while opening MERGE tables
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a VARCHAR(10));
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1);
SELECT * FROM t1;
--error ER_WRONG_MRG_TABLE
SELECT * FROM m1;
SELECT * FROM m2;
DROP TABLE t1, t2, m1, m2;
--echo End of 5.0 tests
#

View file

@ -5,10 +5,13 @@
# Binlog is required
--source include/have_log_bin.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--echo Bug#37938 - Test "mysqldump" lacks various insert statements
--echo Turn off concurrent inserts to avoid random errors
--echo NOTE: We reset the variable back to saved value at the end of test
--echo # Bug#37938 Test "mysqldump" lacks various insert statements
--echo # Turn off concurrent inserts to avoid random errors
--echo # NOTE: We reset the variable back to saved value at the end of test
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT = 0;
@ -23,13 +26,13 @@ drop view if exists v1, v2, v3;
# XML output
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
DROP TABLE t1;
--echo #
--echo # Bug #2005
--echo # Bug#2005 Long decimal comparison bug.
--echo #
CREATE TABLE t1 (a decimal(64, 20));
@ -39,7 +42,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
DROP TABLE t1;
--echo #
--echo # Bug #2055
--echo # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
--echo #
CREATE TABLE t1 (a double);
@ -51,7 +54,7 @@ INSERT INTO t1 VALUES ('-9e999999');
DROP TABLE t1;
--echo #
--echo # Bug #3361 mysqldump quotes DECIMAL values inconsistently
--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
--echo #
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
@ -65,7 +68,7 @@ INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
INSERT INTO t1 VALUES (1.2345, 2.3456);
INSERT INTO t1 VALUES ('1.2345', 2.3456);
--error 1054
--error ER_BAD_FIELD_ERROR
INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET SQL_MODE=@OLD_SQL_MODE;
@ -82,7 +85,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
DROP TABLE t1;
--echo #
--echo # Bug #1707
--echo # Bug#1707 mysqldump -X does't quote field and table names
--echo #
CREATE TABLE t1 (`a"b"` char(2));
@ -91,8 +94,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
DROP TABLE t1;
--echo #
--echo # Bug #1994
--echo # Bug #4261
--echo # Bug#1994 mysqldump does not correctly dump UCS2 data
--echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
--echo #
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
@ -101,7 +104,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
DROP TABLE t1;
--echo #
--echo # Bug #2634
--echo # Bug#2634 mysqldump in --compatible=mysql4
--echo #
CREATE TABLE t1 (a int) ENGINE=MYISAM;
@ -111,7 +114,7 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
--echo #
--echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
--echo # Bug#2592 mysqldump doesn't quote "tricky" names correctly
--echo #
create table ```a` (i int);
@ -119,7 +122,7 @@ create table ```a` (i int);
drop table ```a`;
--echo #
--echo # Bug #2591 "mysqldump quotes names inconsistently"
--echo # Bug#2591 mysqldump quotes names inconsistently
--echo #
create table t1(a int);
@ -132,7 +135,7 @@ set global sql_mode='';
drop table t1;
--echo #
--echo # Bug #2705 'mysqldump --tab extra output'
--echo # Bug#2705 mysqldump --tab extra output
--echo #
create table t1(a int);
@ -148,7 +151,7 @@ insert into t1 values (1),(2),(3);
drop table t1;
--echo #
--echo # Bug #6101: create database problem
--echo # Bug#6101 create database problem
--echo #
--exec $MYSQL_DUMP --skip-comments --databases test
@ -158,7 +161,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
drop database mysqldump_test_db;
--echo #
--echo # Bug #7020
--echo # Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
--echo # Check that we don't dump in UTF8 in compatible mode by default,
--echo # but use the default compiled values, or the values given in
--echo # --default-character-set=xxx. However, we should dump in UTF8
@ -169,8 +172,8 @@ INSERT INTO t1 VALUES (_latin1 '
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
--echo #
--echo # Bug#8063: make test mysqldump [ fail ]
--echo # We cannot tes this command because its output depends
--echo # Bug#8063 make test mysqldump [ fail ]
--echo # We cannot test this command because its output depends
--echo # on --default-character-set incompiled into "mysqldump" program.
--echo # If the future we can move this command into a separate test with
--echo # checking that "mysqldump" is compiled with "latin1"
@ -183,7 +186,7 @@ INSERT INTO t1 VALUES (_latin1 '
DROP TABLE t1;
--echo #
--echo # WL #2319: Exclude Tables from dump
--echo # WL#2319 Exclude Tables from dump
--echo #
CREATE TABLE t1 (a int);
@ -195,7 +198,7 @@ DROP TABLE t1;
DROP TABLE t2;
--echo #
--echo # Bug #8830
--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
--echo #
CREATE TABLE t1 (`b` blob);
@ -207,7 +210,7 @@ DROP TABLE t1;
--echo # Test for --insert-ignore
--echo #
CREATE TABLE t1 (a int);
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
@ -215,7 +218,7 @@ INSERT INTO t1 VALUES (4),(5),(6);
DROP TABLE t1;
--echo #
--echo # Bug #10286: mysqldump -c crashes on table that has many fields with long
--echo # Bug#10286 mysqldump -c crashes on table that has many fields with long
--echo # names
--echo #
create table t1 (
@ -563,7 +566,7 @@ INSERT INTO t1 VALUES (1),(2),(3);
DROP TABLE t1;
--echo #
--echo # Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
--echo # Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
--echo #
CREATE DATABASE mysqldump_test_db;
@ -582,7 +585,7 @@ DROP DATABASE mysqldump_test_db;
--echo #
--echo # Testing with tables and databases that don't exists
--echo # or contains illegal characters
--echo # (Bug #9358 mysqldump crashes if tablename starts with \)
--echo # (Bug#9358 mysqldump crashes if tablename starts with \)
--echo #
create database mysqldump_test_db;
use mysqldump_test_db;
@ -644,7 +647,7 @@ use test;
--echo #
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
--echo # Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
--echo #
create table t1 (a int(10));
@ -655,8 +658,9 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
--echo #
--echo # BUG #12123
--echo # Bug#12123 mysqldump --tab results in text file which can't be imported
--echo #
create table t1 (a text character set utf8, b text character set latin1);
@ -669,14 +673,15 @@ select * from t1;
drop table t1;
--echo #
--echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
--echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
--echo #
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
--echo #
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
--echo # Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
--echo #
create table `t1` (
@ -704,9 +709,11 @@ select * from t1;
show create table `t1`;
drop table `t1`;
--remove_file $MYSQLTEST_VARDIR/tmp/bug19025.sql
--echo #
--echo # Bug #18536: wrong table order
--echo # Bug#18536 wrong table order
--echo #
create table t1(a int);
@ -716,8 +723,9 @@ create table t3(a int);
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
--echo #
--echo # Bug #21288: mysqldump segmentation fault when using --where
--echo # Bug#21288 mysqldump segmentation fault when using --where
--echo #
create table t1 (a int);
@ -725,8 +733,9 @@ create table t1 (a int);
--exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
drop table t1;
--echo #
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
--echo # Bug#13926 --order-by-primary fails if PKEY contains quote character
--echo #
--disable_warnings
@ -746,8 +755,9 @@ DROP TABLE `t1`;
--echo End of 4.1 tests
--echo #
--echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database db1;
@ -770,8 +780,9 @@ drop view v2;
drop database db1;
use test;
--echo #
--echo # Bug 10713 mysqldump includes database in create view and referenced tables
--echo # Bug#10713 mysqldump includes database in create view and referenced tables
--echo #
# create table and views in db2
@ -805,10 +816,11 @@ select * from t2 order by a;
drop table t1, t2;
drop database db1;
use test;
--remove_file $MYSQLTEST_VARDIR/tmp/bug10713.sql
--echo #
--echo # dump of view
--echo #
#
# dump of view
#
create table t1(a int);
create view v1 as select * from t1;
@ -816,8 +828,9 @@ create view v1 as select * from t1;
drop view v1;
drop table t1;
--echo #
--echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database mysqldump_test_db;
@ -841,7 +854,7 @@ drop database mysqldump_test_db;
use test;
--echo #
--echo # Bug #9756
--echo # Bug#9756 mysql client failing on dumps containing certain \ sequences
--echo #
CREATE TABLE t1 (a char(10));
@ -850,7 +863,7 @@ INSERT INTO t1 VALUES ('\'');
DROP TABLE t1;
--echo #
--echo # Bug #10927 mysqldump: Can't reload dump with view that consist of other view
--echo # Bug#10927 mysqldump: Can't reload dump with view that consist of other view
--echo #
create table t1(a int, b int, c varchar(30));
@ -922,7 +935,9 @@ show triggers;
DROP TABLE t1, t2;
--echo #
--echo # Bugs #9136, #12917: problems with --defaults-extra-file option
--echo # Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
--echo # Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
--echo # (Problems with --defaults-extra-file option)
--echo #
--write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
@ -934,7 +949,7 @@ EOF
--remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
--echo #
--echo # Test of fix to BUG 12597
--echo # Test of fix to Bug#12597 mysqldump dumps triggers wrongly
--echo #
DROP TABLE IF EXISTS `test1`;
@ -970,9 +985,11 @@ SELECT * FROM `test2`;
DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test2;
--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump.sql
--echo #
--echo # BUG#9056 - mysqldump does not dump routines
--echo # Bug#9056 mysqldump does not dump routines
--echo #
--disable_warnings
@ -1020,8 +1037,9 @@ DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
drop table t1;
--echo #
--echo # BUG# 13052 - mysqldump timestamp reloads broken
--echo # Bug#13052 mysqldump timestamp reloads broken
--echo #
--disable_warnings
@ -1044,7 +1062,7 @@ set global time_zone=default;
set time_zone=default;
--echo #
--echo # Test of fix to BUG 13146 - ansi quotes break loading of triggers
--echo # Test of fix to Bug#13146 ansi quotes break loading of triggers
--echo #
--disable_warnings
@ -1078,7 +1096,7 @@ DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
--echo #
--echo # BUG# 12838 mysqldump -x with views exits with error
--echo # Bug#12838 mysqldump -x with views exits with error
--echo #
--disable_warnings
@ -1095,13 +1113,14 @@ create view v2 as select * from v0;
select * from v2;
--exec $MYSQL_DUMP -x --skip-comments --databases test
drop view v2;
drop view v0;
drop view v1;
drop table t1;
--echo #
--echo # BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
--echo # Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
--echo # for tables with trigger created in the IGNORE_SPACE sql mode.
--echo #
@ -1125,7 +1144,7 @@ DROP TRIGGER tr1;
DROP TABLE t1;
--echo #
--echo # Bug #13318: Bad result with empty field and --hex-blob
--echo # Bug#13318 Bad result with empty field and --hex-blob
--echo #
create table t1 (a binary(1), b blob);
@ -1135,7 +1154,7 @@ insert into t1 values ('','');
drop table t1;
--echo #
--echo # Bug 14871 Invalid view dump output
--echo # Bug#14871 Invalid view dump output
--echo #
create table t1 (a int);
@ -1162,9 +1181,11 @@ select * from v3 order by a;
drop table t1;
drop view v1, v2, v3, v4, v5;
--remove_file $MYSQLTEST_VARDIR/tmp/bug14871.sql
--echo #
--echo # Bug #16878 dump of trigger
--echo # Bug#16878 dump of trigger
--echo #
create table t1 (a int, created datetime);
@ -1192,6 +1213,8 @@ show triggers;
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
--remove_file $MYSQLTEST_VARDIR/tmp/bug16878.sql
--echo #
--echo # Bug#18462 mysqldump does not dump view structures correctly
@ -1211,11 +1234,15 @@ create view v2 as select qty from v1;
drop view v1;
drop view v2;
drop table t;
--remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
--remove_file $MYSQLTEST_VARDIR/tmp/v2.sql
--remove_file $MYSQLTEST_VARDIR/tmp/t.sql
--remove_file $MYSQLTEST_VARDIR/tmp/t.txt
--echo #
--echo # Bug#14857 Reading dump files with single statement stored routines fails.
--echo # fixed by patch for bug#16878
--echo # fixed by patch for Bug#16878
--echo #
DELIMITER |;
@ -1230,7 +1257,7 @@ drop function f;
drop procedure p;
--echo #
--echo # Bug #17371 Unable to dump a schema with invalid views
--echo # Bug#17371 Unable to dump a schema with invalid views
--echo #
create table t1 ( id serial );
@ -1243,7 +1270,8 @@ drop table t1;
--echo } mysqldump
drop view v1;
--echo # BUG#17201 Spurious 'DROP DATABASE' in output,
--echo # Bug#17201 Spurious 'DROP DATABASE' in output,
--echo # also confusion between tables and views.
--echo # Example code from Markus Popp
@ -1260,8 +1288,9 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
--echo #
--echo # Bug21014 Segmentation fault of mysqldump on view
--echo # Bug#21014 Segmentation fault of mysqldump on view
--echo #
create database mysqldump_tables;
@ -1280,7 +1309,7 @@ drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
--echo #
--echo # Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
--echo # Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
--echo #
create database mysqldump_dba;
@ -1318,6 +1347,7 @@ use mysqldump_dbb;
drop view v1;
drop table t1;
drop database mysqldump_dbb;
--remove_file $MYSQLTEST_VARDIR/tmp/bug20221_backup
use test;
--echo #
@ -1364,11 +1394,12 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
--echo #
--echo # Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
--echo # Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
--echo # information_schema database.
--echo #
--echo # Bug #21424 mysqldump failing to export/import views
--echo # Bug#21424 mysqldump failing to export/import views
--echo #
# Do as root
@ -1389,7 +1420,7 @@ create table u1 (f1 int);
insert into u1 values (4);
create view v1 (c1) as select * from t1;
# Backup should not fail for Bug #21527. Flush priviliges test begins.
# Backup should not fail for Bug#21527. Flush priviliges test begins.
--exec $MYSQL_DUMP --skip-comments --add-drop-table --flush-privileges --ignore-table=mysql.general_log --ignore-table=mysql.slow_log --databases mysqldump_myDB mysql > $MYSQLTEST_VARDIR/tmp/bug21527.sql
# Clean up
@ -1403,7 +1434,8 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
flush privileges;
--echo # Bug #21424 continues from here.
--echo # Bug#21424 continues from here.
--echo # Restore. Flush Privileges test ends.
--echo #
@ -1417,8 +1449,9 @@ use mysqldump_myDB;
select * from mysqldump_myDB.v1;
select * from mysqldump_myDB.u1;
#Final cleanup.
# Final cleanup.
connection root;
disconnect user1;
use mysqldump_myDB;
drop view v1;
drop table t1;
@ -1426,10 +1459,14 @@ drop table u1;
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
connection default;
disconnect root;
--remove_file $MYSQLTEST_VARDIR/tmp/bug21527.sql
use test;
--echo #
--echo # Bug #19745: mysqldump --xml produces invalid xml
--echo # Bug#19745 mysqldump --xml produces invalid xml
--echo #
--disable_warnings
@ -1444,9 +1481,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
DROP TABLE t1;
--echo #
--echo # Bug#26346: stack + buffer overrun in mysqldump
--echo # Bug#26346 stack + buffer overrun in mysqldump
--echo #
CREATE TABLE t1(a int);
@ -1467,18 +1503,20 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
#
# Bug #25993: crashe with a merge table and -c
# Bug#25993 crashes with a merge table and -c
#
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
--exec $MYSQL_DUMP --skip-comments -c test
DROP TABLE t1, t2, t3;
--echo #
--echo # Bug #23491: MySQLDump prefix function call in a view by database name
--echo # Bug#23491 MySQLDump prefix function call in a view by database name
--echo #
# Setup
@ -1508,12 +1546,15 @@ show create view bug23491_restore.v3;
drop database bug23491_original;
drop database bug23491_restore;
use test;
--remove_file $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
--echo #
--echo # Bug 27293: mysqldump crashes when dumping routines
--echo # Bug#27293 mysqldump crashes when dumping routines
--echo # defined by a different user
--echo #
--echo # Bug #22761: mysqldump reports no errors when using
--echo # Bug#22761 mysqldump reports no errors when using
--echo # --routines without mysql.proc privileges
--echo #
@ -1535,13 +1576,14 @@ create procedure mysqldump_test_db.sp1() select 'hello';
drop procedure sp1;
connection default;
disconnect user27293;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
--echo #
--echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob.
--echo # Bug#28522 buffer overrun by '\0' byte using --hex-blob.
--echo #
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
@ -1550,7 +1592,7 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
DROP TABLE t1;
--echo #
--echo # Bug #28524: mysqldump --skip-add-drop-table is not
--echo # Bug#28524 mysqldump --skip-add-drop-table is not
--echo # compatible with views
--echo #
@ -1561,9 +1603,11 @@ DROP VIEW v1;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
SELECT * FROM v1;
DROP VIEW v1;
--remove_file $MYSQLTEST_VARDIR/tmp/bug28524.sql
--echo #
--echo # Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
--echo # Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
--echo # the SQL_MODE variable after the dumping of triggers.
--echo #
@ -1583,9 +1627,11 @@ SELECT * FROM t2;
SELECT * FROM t2;
DROP TABLE t1,t2;
--remove_file $MYSQLTEST_VARDIR/tmp/bug29788.sql
--echo #
--echo # Bug#29815: new option for suppressing last line of mysqldump:
--echo # Bug#29815 new option for suppressing last line of mysqldump:
--echo # "Dump completed on"
--echo #
@ -1623,7 +1669,7 @@ DROP TABLE t1;
# Added for use-thread option
#
# THIS PART OF THE TEST IS DISABLED UNTIL BUG#32991 IS FIXED
# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED
if ($bug32991_fixed) {
create table t1 (a text , b text);
@ -1666,7 +1712,7 @@ drop table words2;
}
--echo #
--echo # BUG# 16853: mysqldump doesn't show events
--echo # Bug#16853 mysqldump doesn't show events
--echo #
create database first;
@ -1685,6 +1731,7 @@ use second;
--exec $MYSQL second < $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
show events;
show create event ee1;
--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
## prove three works (with spaces and tabs on the end)
# start with one from the previous restore
@ -1699,13 +1746,14 @@ use third;
--exec $MYSQL third < $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
show events;
drop database third;
--remove_file $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
# revert back to normal settings
set time_zone = 'SYSTEM';
use test;
--echo #
--echo # BUG#17201 Spurious 'DROP DATABASE' in output,
--echo # Bug#17201 Spurious 'DROP DATABASE' in output,
--echo # also confusion between tables and views.
--echo # Example code from Markus Popp
--echo #
@ -1724,7 +1772,7 @@ drop table t1;
drop database mysqldump_test_db;
#
# BUG#26121 mysqldump includes LOCK TABLES general_log WRITE
# Bug#26121 mysqldump includes LOCK TABLES general_log WRITE
#
--exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql
@ -1733,7 +1781,7 @@ drop database mysqldump_test_db;
###########################################################################
--echo #
--echo # Bug #30027: mysqldump does not dump views properly.
--echo # Bug#30027 mysqldump does not dump views properly.
--echo #
--echo
@ -1784,11 +1832,12 @@ set names latin1;
--echo # Cleanup.
DROP DATABASE mysqldump_test_db;
--remove_file $MYSQLTEST_VARDIR/tmp/bug30027.sql
###########################################################################
--echo #
--echo # BUG#29938: wrong behavior of mysqldump --skip-events
--echo # Bug#29938 wrong behavior of mysqldump --skip-events
--echo # with --all-databases
--echo #
@ -1802,6 +1851,7 @@ SHOW EVENTS;
TRUNCATE mysql.event;
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql
SHOW EVENTS;
--remove_file $MYSQLTEST_VARDIR/tmp/bug29938.sql
--echo #
@ -1818,7 +1868,7 @@ use test;
--echo
--echo # -----------------------------------------------------------------
--echo # -- Bug#30217: Views: changes in metadata behaviour between 5.0 and 5.1.
--echo # -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1.
--echo # -----------------------------------------------------------------
--echo
@ -1863,6 +1913,7 @@ WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
--echo
DROP DATABASE mysqldump_test_db;
--remove_file $MYSQLTEST_VARDIR/tmp/bug30217.sql
--echo
--echo # -- End of test case for Bug#32538.
@ -1877,3 +1928,6 @@ SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
--echo #
--echo # End of 5.1 tests
--echo #
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -3,6 +3,10 @@
--source include/have_ssl.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
--error ER_ACCESS_DENIED_ERROR
connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con2;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con3;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con4;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection default;
disconnect con1;
disconnect con2;
disconnect con3;
disconnect con4;
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
@ -97,7 +105,7 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
# BUG#21611 Slave can't connect when master-ssl-cipher specified
# Bug#21611 Slave can't connect when master-ssl-cipher specified
# - Apparently selecting a cipher doesn't work at all
# - Usa a cipher that both yaSSL and OpenSSL supports
#
@ -115,7 +123,7 @@ drop table t1;
--echo End of 5.0 tests
#
# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in
# Bug#26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in
# Event (see also information_schema.test for the other part of test for
# this bug).
#
@ -171,7 +179,7 @@ SET GLOBAL event_scheduler=0;
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
# Bug #27669 mysqldump: SSL connection error when trying to connect
# Bug#27669 mysqldump: SSL connection error when trying to connect
#
CREATE TABLE t1(a int);
@ -190,9 +198,10 @@ INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
#
# Bug#39172: Asking for DH+non-RSA key with server set to use other key caused
# Bug#39172 Asking for DH+non-RSA key with server set to use other key caused
# YaSSL to crash the server.
#
@ -231,3 +240,6 @@ select 'is still running; no cipher request crashed the server' as result from d
##
--echo End of 5.1 tests
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -5,6 +5,10 @@ eval set @tmpdir="../../tmp";
enable_query_log;
-- source include/have_outfile.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
#
# test of into outfile|dumpfile
#
@ -46,7 +50,7 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1;
# Bug#8191
# Bug#8191 SELECT INTO OUTFILE insists on FROM clause
disable_query_log;
eval select 1 into outfile "../../tmp/outfile-test.4";
enable_query_log;
@ -54,7 +58,7 @@ select load_file(concat(@tmpdir,"/outfile-test.4"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
#
# Bug #5382: 'explain select into outfile' crashes the server
# Bug#5382 'explain select into outfile' crashes the server
#
CREATE TABLE t1 (a INT);
@ -114,6 +118,7 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
disconnect con28181_1;
grant file on *.* to user_1@localhost;
connect (con28181_2,localhost,user_1,,mysqltest);
@ -125,9 +130,12 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
disconnect con28181_2;
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost;
drop database mysqltest;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -4,6 +4,9 @@
# embedded server causes different stat
-- source include/not_embedded.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
# Disable concurrent inserts to avoid sporadic test failures as it might
# affect the the value of variables used throughout the test case.
set @old_concurrent_insert= @@global.concurrent_insert;
@ -88,7 +91,7 @@ show status like 'last_query_cost';
drop table t1;
#
# Test for Bug #15933 max_used_connections is wrong after FLUSH STATUS
# Test for Bug#15933 max_used_connections is wrong after FLUSH STATUS
# if connections are cached
#
#
@ -188,7 +191,7 @@ disconnect con1;
#
# Bug #30377: EXPLAIN loses last_query_cost when used with UNION
# Bug#30377 EXPLAIN loses last_query_cost when used with UNION
#
CREATE TABLE t1 ( a INT );
@ -261,7 +264,7 @@ drop function f1;
show status like 'Com%function';
#
# Bug#37908: Skipped access right check caused server crash.
# Bug#37908 Skipped access right check caused server crash.
#
connect (root, localhost, root,,test);
connection root;
@ -280,13 +283,13 @@ delimiter ;|
connect (user1,localhost,mysqltest_1,,test);
connection user1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
select * from db37908.t1;
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
show status where variable_name ='uptime' and 2 in (select * from db37908.t1);
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t1);
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
show function status where name ='func37908' and 1 in (select func37908());
connection default;
@ -297,6 +300,8 @@ drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
#
# Bug#41131 "Questions" fails to increment - ignores statements instead stored procs
@ -339,3 +344,7 @@ DROP FUNCTION f1;
# Restore global concurrent_insert value. Keep in the end of the test file.
--connection default
set @@global.concurrent_insert= @old_concurrent_insert;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc

View file

@ -65,7 +65,6 @@ create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
alter table t1 modify c char(4);
alter table t1 add d char(2);
--error 1048
update t1 set a=NULL where a=10;
update t1 set c='mysql ab' where c='test';
update t1 set d=c;

View file

@ -575,5 +575,19 @@ SELECT ExtractValue(@xml, 'html/body');
SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
#
# Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507
#
set @x=10;
--error ER_UNKNOWN_ERROR
select extractvalue('<a></a>','$@x/a');
--error ER_UNKNOWN_ERROR
select extractvalue('<a></a>','round(123.4)/a');
--error ER_UNKNOWN_ERROR
select extractvalue('<a></a>','1/a');
--error ER_UNKNOWN_ERROR
select extractvalue('<a></a>','"b"/a');
--error ER_UNKNOWN_ERROR
select extractvalue('<a></a>','(1)/a');
--echo End of 5.1 tests

View file

@ -19,6 +19,10 @@
#include <stdarg.h>
#include <m_ctype.h>
/* Max length of a error message. Should be kept in sync with MYSQL_ERRMSG_SIZE. */
#define ERRMSGSIZE (512)
/* Define some external variables for error handling */
/*
@ -30,8 +34,6 @@
my_printf_error(ER_CODE, format, MYF(N), ...)
*/
char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
/*
Message texts are registered into a linked list of 'my_err_head' structs.
Each struct contains (1.) an array of pointers to C character strings with
@ -75,7 +77,7 @@ int my_error(int nr, myf MyFlags, ...)
const char *format;
struct my_err_head *meh_p;
va_list args;
char ebuff[ERRMSGSIZE + 20];
char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_error");
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno));
@ -112,7 +114,7 @@ int my_error(int nr, myf MyFlags, ...)
int my_printf_error(uint error, const char *format, myf MyFlags, ...)
{
va_list args;
char ebuff[ERRMSGSIZE+20];
char ebuff[ERRMSGSIZE];
DBUG_ENTER("my_printf_error");
DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d Format: %s",
error, MyFlags, errno, format));

View file

@ -153,9 +153,11 @@ void my_end(int infoflag)
{ /* Test if some file is left open */
if (my_file_opened | my_stream_opened)
{
sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
(void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
DBUG_PRINT("error",("%s",errbuff[0]));
char ebuff[512];
my_snprintf(ebuff, sizeof(ebuff), EE(EE_OPEN_WARNING),
my_file_opened, my_stream_opened);
my_message_no_curses(EE_OPEN_WARNING, ebuff, ME_BELL);
DBUG_PRINT("error", ("%s", ebuff));
my_print_open_files();
}
}

View file

@ -147,7 +147,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
error_handler_hook=fatal_error_handler_hook;
if (MyFlags & (MY_FAE+MY_WME))
{
char buff[SC_MAXWIDTH];
char buff[256];
my_errno=errno;
sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename);
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));

View file

@ -1359,7 +1359,8 @@ void thr_downgrade_write_lock(THR_LOCK_DATA *in_data,
/* Upgrade a WRITE_DELAY lock to a WRITE_LOCK */
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
enum thr_lock_type new_lock_type)
{
THR_LOCK *lock=data->lock;
DBUG_ENTER("thr_upgrade_write_delay_lock");
@ -1372,7 +1373,7 @@ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
}
check_locks(lock,"before upgrading lock",0);
/* TODO: Upgrade to TL_WRITE_CONCURRENT_INSERT in some cases */
data->type=TL_WRITE; /* Upgrade lock */
data->type= new_lock_type; /* Upgrade lock */
/* Check if someone has given us the lock */
if (!data->cond)
@ -1411,6 +1412,7 @@ my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data)
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
{
THR_LOCK *lock=data->lock;
enum thr_lock_type write_lock_type;
DBUG_ENTER("thr_reschedule_write_lock");
pthread_mutex_lock(&lock->mutex);
@ -1420,6 +1422,7 @@ my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
DBUG_RETURN(0);
}
write_lock_type= data->type;
data->type=TL_WRITE_DELAYED;
if (lock->update_status)
(*lock->update_status)(data->status_param);
@ -1438,7 +1441,7 @@ my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data)
free_all_read_locks(lock,0);
pthread_mutex_unlock(&lock->mutex);
DBUG_RETURN(thr_upgrade_write_delay_lock(data));
DBUG_RETURN(thr_upgrade_write_delay_lock(data, write_lock_type));
}

View file

@ -1,196 +0,0 @@
#! /bin/sh
# debug
#set -x
# stop on errors
set -e
path=`dirname $0`
# repository direcotry
repo_dir=`pwd`
# build directory
build_dir="$HOME/mydev"
wine_build_dir="F:/mydev"
# doc directory
doc_dir="$repo_dir/../mysqldoc"
# init
target_dir=""
temp_dir=""
revision=""
rev=""
build=""
suffix=""
#obsolete mwenv=""
# show usage
show_usage()
{
cat << EOF
usage: nwbootstrap [options]
Exports a revision of the BitKeeper tree (nwbootstrap must be run inside a
directory of the BitKeeper tree to be used). Creates the ChangeLog file.
Adds the latest manual.texi from the mysqldoc BitKeeper tree. Builds the
Linux tools required for cross-platform builds. Optionally, builds the
binary distributions for NetWare.
options:
--build=<opt> Build the binary distributions for NetWare,
where <opt> is "standard", "debug", or "all"
(default is to not build a binary distribution)
--build-dir=<dir> Export the BitKeeper tree to the <dir> directroy
(default is "$build_dir")
--doc-dir=<dir> Use the mysqldoc BitKeeper tree located in the
<dir> directory
(default is parallel to current BitKeeper tree)
--help Show this help information
--revision=<rev> Export the BitKeeper tree as of revision <rev>
(default is the latest revision)
--wine-build-dir=<dir> Use the WINE directory <dir>, which should
correspond to the --build-dir directory
(default is "$wine_build_dir")
examples:
nwbootstrap
nwbootstrap --revision=1.1594 --build=all
nwbootstrap --build-dir=/home/jdoe/dev --wine-build-dir=F:/dev
EOF
exit 0;
}
# parse arguments
for arg do
case "$arg" in
--build-dir=*) build_dir=`echo "$arg" | sed -e "s;--build-dir=;;"` ;;
--wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;;
--revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;;
--build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
--suffix=*) suffix=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;;
*) show_usage ;;
esac
done
echo "starting build..."
# check for bk and repo_dir
bzr help > /dev/null
repo_dir=`bzr root $repo_dir`
cd $repo_dir
doc_dir="$repo_dir/../mysqldoc"
# build temporary directory
temp_dir="$build_dir/mysql-$$.tmp"
# export the bk tree
command="bzr export";
if test $revision; then command="$command -r$revision"; fi
command="$command $temp_dir"
echo "exporting $repo_dir..."
$command
# determine version
version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < $temp_dir/configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
echo "version: $version"
# build target directory
target_dir="$build_dir/mysql-$version"
# add suffix
if test $suffix
then
target_dir="$target_dir-$suffix"
fi
# delete any old target
if test -d $target_dir.old; then rm -rf $target_dir.old; fi
# rename old target
if test -d $target_dir; then mv -f $target_dir $target_dir.old; fi
# rename directory to use version
mv $temp_dir $target_dir
# create ChangeLog
if test $revision
then
rev=`bk changes -r..$revision -t -d':REV:' -n | head -2 | tail -1`
else
rev=`bk changes -t -d':REV:' -n | head -1`
fi
echo "creating ChangeLog..."
bk changes -v -r$rev..$revision > $target_dir/ChangeLog
# add the latest manual
if test -d $doc_dir
then
echo "adding the latest manual..."
install -m 644 $doc_dir/Docs/{manual,reservedwords}.texi $target_dir/Docs/
fi
# make files writeable
echo "making files writable..."
cd $target_dir
chmod -R u+rw,g+rw .
#obsolete # edit the mvenv file
#obsolete echo "updating the mwenv environment file..."
#obsolete mwenv="./netware/BUILD/mwenv"
#obsolete mv -f $mwenv $mwenv.org
#obsolete sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
#obsolete -e "s;BUILD_DIR;$build_dir;g" \
#obsolete -e "s;VERSION;$version;g" $mwenv.org > $mwenv
#obsolete chmod +rwx $mwenv
#obsolete
#obsolete PWD=`pwd`
#obsolete # This line will catch the default value only, let's hope it is correct
#obsolete SRC_DIR=`grep "^ *export MYDEV=" $mwenv | cut -d'=' -f2 | \
#obsolete sed -e 's;";;g' -e "s;^;echo ;g" -e "s;$;/\`basename $PWD\`;g" | /bin/sh`
# edit the def file versions
echo "updating *.def file versions..."
nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
for file in ./netware/*.def
do
mv -f $file $file.org
sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
rm $file.org
done
# create the libmysql.imp file in netware folder from libmysql/libmysql.def
# file
echo "generating libmysql.imp file..."
awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
# build linux tools
echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools
test -f ./netware/init_db.sql # this must exist
test -f ./netware/test_db.sql # this must exist
# compile
if test $build
then
echo "compiling $build..."
./netware/BUILD/compile-netware-$build
fi
echo "done"

86
netware/BUILD/nwbuild Executable file
View file

@ -0,0 +1,86 @@
#! /bin/sh
# This script builds a Netware binary from a MySQL source tarball
# debug
#set -x
# stop on errors
set -e
# init
build=""
# show usage
show_usage()
{
cat << EOF
usage: nwbuild [options]
Build Netware binary from source .tar.gz
options:
--build=<opt> Build the binary distributions for NetWare,
where <opt> is "standard", "debug", or "all"
(default is to not build a binary distribution)
--help Show this help information
Examples:
./netware/BUILD/nwbuild --build=debug
./netware/BUILD/nwbuild --build=standard
EOF
}
# parse arguments
for arg do
case "$arg" in
--build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
--help) show_usage; exit 0 ;;
*) show_usage >&2; exit 1 ;;
esac
done
# determine version
version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
echo "version: $version"
# make files writeable
echo "making files writable..."
chmod -R u+rw,g+rw .
# edit the def file versions
nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
echo "updating *.def file versions to $nlm_version..."
for file in ./netware/*.def
do
mv -f $file $file.org
sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
rm $file.org
done
# create the libmysql.imp file in netware folder from libmysql/libmysql.def
# file
echo "generating libmysql.imp file..."
awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
# build linux tools
echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools
test -f ./netware/init_db.sql # this must exist
test -f ./netware/test_db.sql # this must exist
# compile
if test $build
then
echo "compiling $build..."
./netware/BUILD/compile-netware-$build
else
echo "Preparation complete. Use ./netware/BUILD/compile-netware-* to build MySQL."
fi
echo "done"

View file

@ -94,7 +94,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
BUILD/compile-netware-standard BUILD/create-patch \
BUILD/cron-build BUILD/crontab BUILD/knetware.imp \
BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch
BUILD/nwbuild BUILD/openssl.imp BUILD/save-patch
endif

View file

@ -60,13 +60,16 @@ STRIP=1 # Option ignored
SILENT=0
PLATFORM=""
TMP=/tmp
NEW_NAME="" # Final top directory and TAR package name
SUFFIX=""
SHORT_PRODUCT_TAG="" # If don't want server suffix in package name
NDBCLUSTER="" # Option ignored
for arg do
case "$arg" in
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
--short-product-tag=*) SHORT_PRODUCT_TAG=`echo "$arg" | sed -e "s;--short-product-tag=;;"` ;;
--no-strip) STRIP=0 ;;
--machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;;
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
@ -113,7 +116,11 @@ case $PLATFORM in
esac
# Change the distribution to a long descriptive name
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX
if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then
NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX
else
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX
fi
# ----------------------------------------------------------------------
# Define BASE, and remove the old BASE directory if any

View file

@ -293,7 +293,12 @@ sub start_mysqlds()
@groups = &find_groups($groupids);
for ($i = 0; defined($groups[$i]); $i++)
{
# Defaults are made explicit parameters to server execution...
@options = defaults_for_group($groups[$i]);
# ...so server MUST NOT try to read again from some config file, especially
# as the "right" file may be unknown to the server if we are using
# --defaults-file=... params in here.
unshift(@options,"--no-defaults");
$mysqld_found= 1; # The default
$mysqld_found= 0 if (!length($mysqld));

View file

@ -47,7 +47,7 @@ $opt_machine=""; $opt_suffix="";
$opt_create_options=undef;
$opt_optimization="None";
$opt_hw="";
$opt_threads=5;
$opt_threads=-1;
if (!defined($opt_time_limit))
{
@ -68,6 +68,11 @@ $limits=merge_limits($server,$opt_cmp);
$date=date();
@estimated=(0.0,0.0,0.0); # For estimated time support
if ($opt_threads != -1)
{
print "WARNING: Option --threads is deprecated and has no effect\n"
}
if ($opt_hires)
{
eval "use Time::HiRes;";
@ -560,8 +565,8 @@ All benchmarks takes the following options:
Inform test suite that we are generate random inital values for sequence of
test executions. It should be used for imitation of real conditions.
--threads=# (Default 5)
Number of threads for multi-user benchmarks.
--threads=# **DEPRECATED**
This option has no effect, and will be removed in a future version.
--tcpip
Inform test suite that we are using TCP/IP to connect to the server. In

View file

@ -1274,13 +1274,26 @@ Item::Type Item_name_const::type() const
valid_args guarantees value_item->basic_const_item(); if type is
FUNC_ITEM, then we have a fudged item_func_neg() on our hands
and return the underlying type.
For Item_func_set_collation()
e.g. NAME_CONST('name', 'value' COLLATE collation) we return its
'value' argument type.
*/
return valid_args ?
(((value_item->type() == FUNC_ITEM) &&
(((Item_func *) value_item)->functype() == Item_func::NEG_FUNC)) ?
((Item_func *) value_item)->key_item()->type() :
value_item->type()) :
NULL_ITEM;
if (!valid_args)
return NULL_ITEM;
Item::Type value_type= value_item->type();
if (value_type == FUNC_ITEM)
{
/*
The second argument of NAME_CONST('name', 'value') must be
a simple constant item or a NEG_FUNC/COLLATE_FUNC.
*/
DBUG_ASSERT(((Item_func *) value_item)->functype() ==
Item_func::NEG_FUNC ||
((Item_func *) value_item)->functype() ==
Item_func::COLLATE_FUNC);
return ((Item_func *) value_item)->key_item()->type();
}
return value_type;
}

View file

@ -419,6 +419,7 @@ public:
{
return save_time_in_field(field);
}
longlong val_int() { return val_int_from_decimal(); }
bool result_as_longlong() { return TRUE; }
};

View file

@ -1969,6 +1969,13 @@ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(MY_XPATH *xpath)
if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
return 1;
if (xpath->item->type() != Item::XPATH_NODESET)
{
xpath->lasttok= xpath->prevtok;
xpath->error= 1;
return 0;
}
my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH);
return my_xpath_parse_RelativeLocationPath(xpath);
}
@ -1976,7 +1983,6 @@ static int my_xpath_parse_PathExpr(MY_XPATH *xpath)
{
return my_xpath_parse_LocationPath(xpath) ||
my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath(xpath);
}

View file

@ -53,6 +53,8 @@
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD* thd);
static const char *HA_ERR(int i)
{
switch (i) {
@ -2894,7 +2896,37 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
if (strcmp("COMMIT", query) == 0 && rli->tables_to_lock)
{
/*
Cleaning-up the last statement context:
the terminal event of the current statement flagged with
STMT_END_F got filtered out in ndb circular replication.
*/
int error;
char llbuff[22];
if ((error= rows_event_stmt_cleanup(const_cast<Relay_log_info*>(rli), thd)))
{
const_cast<Relay_log_info*>(rli)->report(ERROR_LEVEL, error,
"Error in cleaning up after an event preceeding the commit; "
"the group log file/position: %s %s",
const_cast<Relay_log_info*>(rli)->group_master_log_name,
llstr(const_cast<Relay_log_info*>(rli)->group_master_log_pos,
llbuff));
}
/*
Executing a part of rli->stmt_done() logics that does not deal
with group position change. The part is redundant now but is
future-change-proof addon, e.g if COMMIT handling will start checking
invariants like IN_STMT flag must be off at committing the transaction.
*/
const_cast<Relay_log_info*>(rli)->inc_event_relay_log_pos();
const_cast<Relay_log_info*>(rli)->clear_flag(Relay_log_info::IN_STMT);
}
else
{
const_cast<Relay_log_info*>(rli)->clear_tables_to_lock();
}
/*
Note: We do not need to execute reset_one_shot_variables() if this
@ -7403,16 +7435,20 @@ Rows_log_event::do_shall_skip(Relay_log_info *rli)
return Log_event::do_shall_skip(rli);
}
int
Rows_log_event::do_update_pos(Relay_log_info *rli)
/**
The function is called at Rows_log_event statement commit time,
normally from Rows_log_event::do_update_pos() and possibly from
Query_log_event::do_apply_event() of the COMMIT.
The function commits the last statement for engines, binlog and
releases resources have been allocated for the statement.
@retval 0 Ok.
@retval non-zero Error at the commit.
*/
static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd)
{
DBUG_ENTER("Rows_log_event::do_update_pos");
int error= 0;
DBUG_PRINT("info", ("flags: %s",
get_flags(STMT_END_F) ? "STMT_END_F " : ""));
if (get_flags(STMT_END_F))
int error;
{
/*
This is the end of a statement or transaction, so close (and
@ -7454,8 +7490,33 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd->reset_current_stmt_binlog_row_based();
rli->cleanup_context(thd, 0);
if (error == 0)
const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 0);
}
return error;
}
/**
The method either increments the relay log position or
commits the current statement and increments the master group
possition if the event is STMT_END_F flagged and
the statement corresponds to the autocommit query (i.e replicated
without wrapping in BEGIN/COMMIT)
@retval 0 Success
@retval non-zero Error in the statement commit
*/
int
Rows_log_event::do_update_pos(Relay_log_info *rli)
{
DBUG_ENTER("Rows_log_event::do_update_pos");
int error= 0;
DBUG_PRINT("info", ("flags: %s",
get_flags(STMT_END_F) ? "STMT_END_F " : ""));
if (get_flags(STMT_END_F))
{
if ((error= rows_event_stmt_cleanup(rli, thd)) == 0)
{
/*
Indicate that a statement is finished.
@ -7475,12 +7536,14 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd->clear_error();
}
else
{
rli->report(ERROR_LEVEL, error,
"Error in %s event: commit of row events failed, "
"table `%s`.`%s`",
get_type_str(), m_table->s->db.str,
m_table->s->table_name.str);
}
}
else
{
rli->inc_event_relay_log_pos();

View file

@ -1953,6 +1953,7 @@ extern my_bool opt_log, opt_slow_log;
extern ulong log_output_options;
extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
extern bool opt_ignore_builtin_innodb;
extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop, shutdown_in_progress;
extern uint volatile thread_count, thread_running, global_read_lock;

View file

@ -378,7 +378,7 @@ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache;
/* Global variables */
bool opt_update_log, opt_bin_log;
bool opt_update_log, opt_bin_log, opt_ignore_builtin_innodb= 0;
my_bool opt_log, opt_slow_log;
ulong log_output_options;
my_bool opt_log_queries_not_using_indexes= 0;
@ -5585,7 +5585,8 @@ enum options_mysqld
OPT_OLD_MODE,
OPT_SLAVE_EXEC_MODE,
OPT_GENERAL_LOG_FILE,
OPT_SLOW_QUERY_LOG_FILE
OPT_SLOW_QUERY_LOG_FILE,
OPT_IGNORE_BUILTIN_INNODB
};
@ -5791,6 +5792,9 @@ Disable with --skip-large-pages.",
(uchar**) &opt_large_pages, (uchar**) &opt_large_pages, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#endif
{"ignore-builtin-innodb", OPT_IGNORE_BUILTIN_INNODB ,
"Disable initialization of builtin InnoDB plugin",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"init-connect", OPT_INIT_CONNECT, "Command(s) that are executed for each new connection",
(uchar**) &opt_init_connect, (uchar**) &opt_init_connect, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -7484,6 +7488,7 @@ static int mysql_init_variables(void)
log_output_options= find_bit_type(log_output_str, &log_output_typelib);
opt_bin_log= 0;
opt_disable_networking= opt_skip_show_db=0;
opt_ignore_builtin_innodb= 0;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
opt_secure_auth= 0;
@ -7781,6 +7786,9 @@ mysqld_get_one_option(int optid,
case (int) OPT_BIG_TABLES:
thd_startup_options|=OPTION_BIG_TABLES;
break;
case (int) OPT_IGNORE_BUILTIN_INNODB:
opt_ignore_builtin_innodb= 1;
break;
case (int) OPT_ISAM_LOG:
opt_myisam_log=1;
break;

View file

@ -275,6 +275,11 @@ static sys_var_const sys_ft_query_expansion_limit(&vars,
static sys_var_const sys_ft_stopword_file(&vars, "ft_stopword_file",
OPT_GLOBAL, SHOW_CHAR_PTR,
(uchar*) &ft_stopword_file);
static sys_var_const sys_ignore_builtin_innodb(&vars, "ignore_builtin_innodb",
OPT_GLOBAL, SHOW_BOOL,
(uchar*) &opt_ignore_builtin_innodb);
sys_var_str sys_init_connect(&vars, "init_connect", 0,
sys_update_init_connect,
sys_default_init_connect,0);

View file

@ -571,30 +571,30 @@ ER_ERROR_ON_READ
swe "Fick fel vid läsning av '%-.200s' (Felkod %d)"
ukr "îÅ ÍÏÖÕ ÐÒÏÞÉÔÁÔÉ ÆÁÊÌ '%-.200s' (ÐÏÍÉÌËÁ: %d)"
ER_ERROR_ON_RENAME
cze "Chyba p-Bøi pøejmenování '%-.150s' na '%-.150s' (chybový kód: %d)"
dan "Fejl ved omdøbning af '%-.150s' til '%-.150s' (Fejlkode: %d)"
nla "Fout bij het hernoemen van '%-.150s' naar '%-.150s' (Errcode: %d)"
eng "Error on rename of '%-.150s' to '%-.150s' (errno: %d)"
jps "'%-.150s' ‚ð '%-.150s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)",
est "Viga faili '%-.150s' ümbernimetamisel '%-.150s'-ks (veakood: %d)"
fre "Erreur en renommant '%-.150s' en '%-.150s' (Errcode: %d)"
ger "Fehler beim Umbenennen von '%-.150s' in '%-.150s' (Fehler: %d)"
greek "Ðñüâëçìá êáôÜ ôçí ìåôïíïìáóßá ôïõ áñ÷åßïõ '%-.150s' to '%-.150s' (êùäéêüò ëÜèïõò: %d)"
hun "Hiba a '%-.150s' file atnevezesekor '%-.150s'. (hibakod: %d)"
ita "Errore durante la rinominazione da '%-.150s' a '%-.150s' (errno: %d)"
jpn "'%-.150s' ¤ò '%-.150s' ¤Ë rename ¤Ç¤­¤Þ¤»¤ó (errno: %d)"
kor "'%-.150s'¸¦ '%-.150s'·Î À̸§ º¯°æÁß ¿¡·¯ (¿¡·¯¹øÈ£: %d)"
nor "Feil ved omdøping av '%-.150s' til '%-.150s' (Feilkode: %d)"
norwegian-ny "Feil ved omdøyping av '%-.150s' til '%-.150s' (Feilkode: %d)"
pol "B³?d podczas zmieniania nazwy '%-.150s' na '%-.150s' (Kod b³êdu: %d)"
por "Erro ao renomear '%-.150s' para '%-.150s' (erro no. %d)"
rum "Eroare incercind sa renumesc '%-.150s' in '%-.150s' (errno: %d)"
rus "ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.150s' × '%-.150s' (ÏÛÉÂËÁ: %d)"
serbian "Greška pri promeni imena '%-.150s' na '%-.150s' (errno: %d)"
slo "Chyba pri premenovávaní '%-.150s' na '%-.150s' (chybový kód: %d)"
spa "Error en el renombrado de '%-.150s' a '%-.150s' (Error: %d)"
swe "Kan inte byta namn från '%-.150s' till '%-.150s' (Felkod: %d)"
ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÍÅÎÕ×ÁÔÉ '%-.150s' Õ '%-.150s' (ÐÏÍÉÌËÁ: %d)"
cze "Chyba p-Bøi pøejmenování '%-.210s' na '%-.210s' (chybový kód: %d)"
dan "Fejl ved omdøbning af '%-.210s' til '%-.210s' (Fejlkode: %d)"
nla "Fout bij het hernoemen van '%-.210s' naar '%-.210s' (Errcode: %d)"
eng "Error on rename of '%-.210s' to '%-.210s' (errno: %d)"
jps "'%-.210s' ‚ð '%-.210s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)",
est "Viga faili '%-.210s' ümbernimetamisel '%-.210s'-ks (veakood: %d)"
fre "Erreur en renommant '%-.210s' en '%-.210s' (Errcode: %d)"
ger "Fehler beim Umbenennen von '%-.210s' in '%-.210s' (Fehler: %d)"
greek "Ðñüâëçìá êáôÜ ôçí ìåôïíïìáóßá ôïõ áñ÷åßïõ '%-.210s' to '%-.210s' (êùäéêüò ëÜèïõò: %d)"
hun "Hiba a '%-.210s' file atnevezesekor '%-.210s'. (hibakod: %d)"
ita "Errore durante la rinominazione da '%-.210s' a '%-.210s' (errno: %d)"
jpn "'%-.210s' ¤ò '%-.210s' ¤Ë rename ¤Ç¤­¤Þ¤»¤ó (errno: %d)"
kor "'%-.210s'¸¦ '%-.210s'·Î À̸§ º¯°æÁß ¿¡·¯ (¿¡·¯¹øÈ£: %d)"
nor "Feil ved omdøping av '%-.210s' til '%-.210s' (Feilkode: %d)"
norwegian-ny "Feil ved omdøyping av '%-.210s' til '%-.210s' (Feilkode: %d)"
pol "B³?d podczas zmieniania nazwy '%-.210s' na '%-.210s' (Kod b³êdu: %d)"
por "Erro ao renomear '%-.210s' para '%-.210s' (erro no. %d)"
rum "Eroare incercind sa renumesc '%-.210s' in '%-.210s' (errno: %d)"
rus "ïÛÉÂËÁ ÐÒÉ ÐÅÒÅÉÍÅÎÏ×ÁÎÉÉ '%-.210s' × '%-.210s' (ÏÛÉÂËÁ: %d)"
serbian "Greška pri promeni imena '%-.210s' na '%-.210s' (errno: %d)"
slo "Chyba pri premenovávaní '%-.210s' na '%-.210s' (chybový kód: %d)"
spa "Error en el renombrado de '%-.210s' a '%-.210s' (Error: %d)"
swe "Kan inte byta namn från '%-.210s' till '%-.210s' (Felkod: %d)"
ukr "îÅ ÍÏÖÕ ÐÅÒÅÊÍÅÎÕ×ÁÔÉ '%-.210s' Õ '%-.210s' (ÐÏÍÉÌËÁ: %d)"
ER_ERROR_ON_WRITE
cze "Chyba p-Bøi zápisu do souboru '%-.200s' (chybový kód: %d)"
dan "Fejl ved skriving av filen '%-.200s' (Fejlkode: %d)"

View file

@ -3660,16 +3660,14 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
if (lex->is_stmt_unsafe() &&
variables.binlog_format == BINLOG_FORMAT_STMT)
{
DBUG_ASSERT(this->query != NULL);
push_warning(this, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_BINLOG_UNSAFE_STATEMENT,
ER(ER_BINLOG_UNSAFE_STATEMENT));
if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED))
{
char warn_buf[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buf, MYSQL_ERRMSG_SIZE, "%s Statement: %s",
ER(ER_BINLOG_UNSAFE_STATEMENT), this->query);
sql_print_warning(warn_buf);
sql_print_warning("%s Statement: %.*s",
ER(ER_BINLOG_UNSAFE_STATEMENT),
MYSQL_ERRMSG_SIZE, query_arg);
binlog_flags|= BINLOG_FLAG_UNSAFE_STMT_PRINTED;
}
}

View file

@ -177,7 +177,7 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
uint code, const char *format, ...)
{
va_list args;
char warning[ERRMSGSIZE+20];
char warning[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("push_warning_printf");
DBUG_PRINT("enter",("warning: %u", code));

View file

@ -1690,6 +1690,7 @@ public:
class Delayed_insert :public ilink {
uint locks_in_memory;
thr_lock_type delayed_lock;
public:
THD thd;
TABLE *table;
@ -1731,6 +1732,8 @@ public:
pthread_cond_init(&cond_client,NULL);
VOID(pthread_mutex_lock(&LOCK_thread_count));
delayed_insert_threads++;
delayed_lock= global_system_variables.low_priority_updates ?
TL_WRITE_LOW_PRIORITY : TL_WRITE;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
}
~Delayed_insert()
@ -2540,7 +2543,7 @@ bool Delayed_insert::handle_inserts(void)
table->use_all_columns();
thd_proc_info(&thd, "upgrading lock");
if (thr_upgrade_write_delay_lock(*thd.lock->locks))
if (thr_upgrade_write_delay_lock(*thd.lock->locks, delayed_lock))
{
/*
This can happen if thread is killed either by a shutdown

View file

@ -5454,9 +5454,10 @@ bool check_stack_overrun(THD *thd, long margin,
if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
(long) (my_thread_stack_size - margin))
{
sprintf(errbuff[0],ER(ER_STACK_OVERRUN_NEED_MORE),
stack_used,my_thread_stack_size,margin);
my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(0));
char ebuff[MYSQL_ERRMSG_SIZE];
my_snprintf(ebuff, sizeof(ebuff), ER(ER_STACK_OVERRUN_NEED_MORE),
stack_used, my_thread_stack_size, margin);
my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
thd->fatal_error();
return 1;
}

View file

@ -1138,6 +1138,9 @@ int plugin_init(int *argc, char **argv, int flags)
{
for (plugin= *builtins; plugin->info; plugin++)
{
if (opt_ignore_builtin_innodb &&
!my_strcasecmp(&my_charset_latin1, plugin->name, "InnoDB"))
continue;
/* by default, ndbcluster and federated are disabled */
def_enabled=
my_strcasecmp(&my_charset_latin1, plugin->name, "NDBCLUSTER") != 0 &&

View file

@ -87,7 +87,6 @@ static store_key *get_store_key(THD *thd,
KEYUSE *keyuse, table_map used_tables,
KEY_PART_INFO *key_part, uchar *key_buff,
uint maybe_null);
static bool make_simple_join(JOIN *join,TABLE *tmp_table);
static void make_outerjoin_info(JOIN *join);
static bool make_join_select(JOIN *join,SQL_SELECT *select,COND *item);
static void make_join_readinfo(JOIN *join, ulonglong options);
@ -1879,7 +1878,7 @@ JOIN::exec()
/* Free first data from old join */
curr_join->join_free();
if (make_simple_join(curr_join, curr_tmp_table))
if (curr_join->make_simple_join(this, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, group_list);
count_field_types(select_lex, &curr_join->tmp_table_param,
@ -2002,7 +2001,7 @@ JOIN::exec()
curr_join->select_distinct=0;
}
curr_tmp_table->reginfo.lock_type= TL_UNLOCK;
if (make_simple_join(curr_join, curr_tmp_table))
if (curr_join->make_simple_join(this, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, curr_join->group_list);
count_field_types(select_lex, &curr_join->tmp_table_param,
@ -5686,48 +5685,42 @@ store_val_in_field(Field *field, Item *item, enum_check_fields check_flag)
}
static bool
make_simple_join(JOIN *join,TABLE *tmp_table)
/**
@details Initialize a JOIN as a query execution plan
that accesses a single table via a table scan.
@param parent contains JOIN_TAB and TABLE object buffers for this join
@param tmp_table temporary table
@retval FALSE success
@retval TRUE error occurred
*/
bool
JOIN::make_simple_join(JOIN *parent, TABLE *tmp_table)
{
TABLE **tableptr;
JOIN_TAB *join_tab;
DBUG_ENTER("make_simple_join");
DBUG_ENTER("JOIN::make_simple_join");
/*
Reuse TABLE * and JOIN_TAB if already allocated by a previous call
to this function through JOIN::exec (may happen for sub-queries).
*/
if (!join->table_reexec)
{
if (!(join->table_reexec= (TABLE**) join->thd->alloc(sizeof(TABLE*))))
if (!parent->join_tab_reexec &&
!(parent->join_tab_reexec= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB))))
DBUG_RETURN(TRUE); /* purecov: inspected */
if (join->tmp_join)
join->tmp_join->table_reexec= join->table_reexec;
}
if (!join->join_tab_reexec)
{
if (!(join->join_tab_reexec=
(JOIN_TAB*) join->thd->alloc(sizeof(JOIN_TAB))))
DBUG_RETURN(TRUE); /* purecov: inspected */
if (join->tmp_join)
join->tmp_join->join_tab_reexec= join->join_tab_reexec;
}
tableptr= join->table_reexec;
join_tab= join->join_tab_reexec;
join->join_tab=join_tab;
join->table=tableptr; tableptr[0]=tmp_table;
join->tables=1;
join->const_tables=0;
join->const_table_map=0;
join->tmp_table_param.field_count= join->tmp_table_param.sum_func_count=
join->tmp_table_param.func_count=0;
join->tmp_table_param.copy_field=join->tmp_table_param.copy_field_end=0;
join->first_record=join->sort_and_group=0;
join->send_records=(ha_rows) 0;
join->group=0;
join->row_limit=join->unit->select_limit_cnt;
join->do_send_rows = (join->row_limit) ? 1 : 0;
join_tab= parent->join_tab_reexec;
table= &parent->table_reexec[0]; parent->table_reexec[0]= tmp_table;
tables= 1;
const_tables= 0;
const_table_map= 0;
tmp_table_param.field_count= tmp_table_param.sum_func_count=
tmp_table_param.func_count= 0;
tmp_table_param.copy_field= tmp_table_param.copy_field_end=0;
first_record= sort_and_group=0;
send_records= (ha_rows) 0;
group= 0;
row_limit= unit->select_limit_cnt;
do_send_rows= row_limit ? 1 : 0;
join_tab->cache.buff=0; /* No caching */
join_tab->table=tmp_table;
@ -5744,7 +5737,7 @@ make_simple_join(JOIN *join,TABLE *tmp_table)
join_tab->ref.key = -1;
join_tab->not_used_in_distinct=0;
join_tab->read_first_record= join_init_read_record;
join_tab->join=join;
join_tab->join= this;
join_tab->ref.key_parts= 0;
bzero((char*) &join_tab->read_record,sizeof(join_tab->read_record));
tmp_table->status=0;

View file

@ -402,9 +402,12 @@ public:
cleared only at the end of the execution of the whole query and not caching
allocations that occur in repetition at execution time will result in
excessive memory usage.
Note: make_simple_join always creates an execution plan that accesses
a single table, thus it is sufficient to have a one-element array for
table_reexec.
*/
SORT_FIELD *sortorder; // make_unireg_sortorder()
TABLE **table_reexec; // make_simple_join()
TABLE *table_reexec[1]; // make_simple_join()
JOIN_TAB *join_tab_reexec; // make_simple_join()
/* end of allocation caching storage */
@ -434,7 +437,7 @@ public:
exec_tmp_table1= 0;
exec_tmp_table2= 0;
sortorder= 0;
table_reexec= 0;
table_reexec[0]= 0;
join_tab_reexec= 0;
thd= thd_arg;
sum_funcs= sum_funcs2= 0;
@ -526,6 +529,8 @@ public:
return (unit == &thd->lex->unit && (unit->fake_select_lex == 0 ||
select_lex == unit->fake_select_lex));
}
private:
bool make_simple_join(JOIN *join, TABLE *tmp_table);
};

View file

@ -4435,8 +4435,8 @@ send_result_message:
switch (result_code) {
case HA_ADMIN_NOT_IMPLEMENTED:
{
char buf[ERRMSGSIZE+20];
uint length=my_snprintf(buf, ERRMSGSIZE,
char buf[MYSQL_ERRMSG_SIZE];
uint length=my_snprintf(buf, sizeof(buf),
ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
@ -4445,8 +4445,8 @@ send_result_message:
case HA_ADMIN_NOT_BASE_TABLE:
{
char buf[ERRMSGSIZE+20];
uint length= my_snprintf(buf, ERRMSGSIZE,
char buf[MYSQL_ERRMSG_SIZE];
uint length= my_snprintf(buf, sizeof(buf),
ER(ER_BAD_TABLE_ERROR), table_name);
protocol->store(STRING_WITH_LEN("note"), system_charset_info);
protocol->store(buf, length, system_charset_info);
@ -4573,11 +4573,12 @@ send_result_message:
case HA_ADMIN_NEEDS_UPGRADE:
case HA_ADMIN_NEEDS_ALTER:
{
char buf[ERRMSGSIZE];
char buf[MYSQL_ERRMSG_SIZE];
uint length;
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
length=my_snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name);
length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
table->table_name);
protocol->store(buf, length, system_charset_info);
fatal_error=1;
break;
@ -4585,8 +4586,8 @@ send_result_message:
default: // Probably HA_ADMIN_INTERNAL_ERROR
{
char buf[ERRMSGSIZE+20];
uint length=my_snprintf(buf, ERRMSGSIZE,
char buf[MYSQL_ERRMSG_SIZE];
uint length=my_snprintf(buf, sizeof(buf),
"Unknown - internal error %d during operation",
result_code);
protocol->store(STRING_WITH_LEN("error"), system_charset_info);

View file

@ -526,9 +526,11 @@ int mysql_update(THD *thd,
init_read_record(&info, thd, table, select, 0, 1, FALSE);
updated= found= 0;
/* Generate an error when trying to set a NOT NULL field to NULL. */
thd->count_cuted_fields= ignore ? CHECK_FIELD_WARN
: CHECK_FIELD_ERROR_FOR_NULL;
/*
Generate an error (in TRADITIONAL mode) or warning
when trying to set a NOT NULL field to NULL.
*/
thd->count_cuted_fields= CHECK_FIELD_WARN;
thd->cuted_fields=0L;
thd_proc_info(thd, "Updating");

View file

@ -3577,7 +3577,8 @@ ha_innobase::write_row(
/* out: error code */
uchar* record) /* in: a row in MySQL format */
{
int error = 0;
ulint error = 0;
int error_result= 0;
ibool auto_inc_used= FALSE;
ulint sql_command;
trx_t* trx = thd_to_trx(user_thd);
@ -3693,6 +3694,7 @@ no_commit:
}
/* MySQL errors are passed straight back. */
error_result = (int) error;
goto func_exit;
}
@ -3786,7 +3788,7 @@ set_max_autoinc:
err = innobase_set_max_autoinc(auto_inc);
if (err != DB_SUCCESS) {
error = (int) err;
error = err;
}
}
break;
@ -3796,12 +3798,12 @@ set_max_autoinc:
innodb_srv_conc_exit_innodb(prebuilt->trx);
report_error:
error = convert_error_code_to_mysql(error, user_thd);
error_result = convert_error_code_to_mysql((int) error, user_thd);
func_exit:
innobase_active_small();
DBUG_RETURN(error);
DBUG_RETURN(error_result);
}
/**************************************************************************

View file

@ -1257,7 +1257,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
ulonglong map;
TABLE_LIST *table_list= table->pos_in_table_list;
my_bool ignore_leaves= table_list->ignore_leaves;
char buf[ERRMSGSIZE+20];
char buf[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("ha_myisam::preload_keys");
@ -1285,7 +1285,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
errmsg= "Failed to allocate buffer";
break;
default:
my_snprintf(buf, ERRMSGSIZE,
my_snprintf(buf, sizeof(buf),
"Failed to read from index file (errno: %d)", my_errno);
errmsg= buf;
}

View file

@ -47,6 +47,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
MI_INFO *isam=0;
uint found_merge_insert_method= 0;
size_t name_buff_length;
my_bool bad_children= FALSE;
DBUG_ENTER("myrg_open");
LINT_INIT(key_parts);
@ -97,13 +98,13 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
fn_format(buff, buff, "", "", 0);
if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
{
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(buff);
bad_children= TRUE;
continue;
}
goto err;
goto bad_children;
}
if (!m_info) /* First file */
{
@ -128,13 +129,13 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
files++;
if (m_info->reclength != isam->s->base.reclength)
{
my_errno=HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(buff);
bad_children= TRUE;
continue;
}
goto err;
goto bad_children;
}
m_info->options|= isam->s->options;
m_info->records+= isam->state->records;
@ -147,8 +148,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
m_info->tables);
}
if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
goto err;
if (bad_children)
goto bad_children;
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
MYF(MY_WME | MY_ZEROFILL))))
goto err;
@ -178,12 +179,14 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_RETURN(m_info);
bad_children:
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
err:
save_errno=my_errno;
switch (errpos) {
case 3:
while (files)
mi_close(m_info->open_tables[--files].table);
(void) mi_close(m_info->open_tables[--files].table);
my_free((char*) m_info,MYF(0));
/* Fall through */
case 2:
@ -392,6 +395,7 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
uint child_nr;
uint key_parts;
uint min_keys;
my_bool bad_children= FALSE;
DBUG_ENTER("myrg_attach_children");
DBUG_PRINT("myrg", ("handle_locking: %d", handle_locking));
@ -441,13 +445,13 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
DBUG_PRINT("error", ("definition mismatch table: '%s' repair: %d",
myisam->filename,
(handle_locking & HA_OPEN_FOR_REPAIR)));
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
if (handle_locking & HA_OPEN_FOR_REPAIR)
{
myrg_print_wrong_table(myisam->filename);
bad_children= TRUE;
continue;
}
goto err;
goto bad_children;
}
m_info->options|= myisam->s->options;
@ -462,6 +466,9 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
child_nr++;
}
if (bad_children)
goto bad_children;
/* Note: callback() resets my_errno, so it is safe to check it here */
if (my_errno == HA_ERR_WRONG_MRG_TABLE_DEF)
goto err;
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
@ -477,6 +484,8 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
pthread_mutex_unlock(&m_info->mutex);
DBUG_RETURN(0);
bad_children:
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
err:
save_errno= my_errno;
switch (errpos) {