Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun14/50 configure.in: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/binlog.result: Auto merged mysql-test/r/have_log_bin.require: Auto merged BitKeeper/deleted/.del-ctype_cp932_notembedded.test: Auto merged mysql-test/t/binlog.test: Auto merged mysql-test/t/ctype_cp932_binlog.test: Auto merged mysql-test/t/ctype_ucs_binlog.test: Auto merged mysql-test/t/flush_block_commit_notembedded.test: Auto merged mysql-test/t/insert_select-binlog.test: Auto merged mysql-test/t/mysqlbinlog-cp932.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/sp_trans.test: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged mysql-test/r/mix_innodb_myisam_binlog.result: Use local mysql-test/t/blackhole.test: manual merge mysql-test/t/drop_temp_table.test: manual merge mysql-test/t/mix_innodb_myisam_binlog.test: Use local mysql-test/t/mysqlbinlog.test: Use local
This commit is contained in:
commit
cb93ff4d02
@ -90,6 +90,16 @@ extern char* tgoto(const char*, int, int);
|
||||
extern char* tgetstr(char*, char**);
|
||||
#endif
|
||||
|
||||
|
||||
#if !HAVE_DECL_TGOTO
|
||||
/*
|
||||
'tgoto' is not declared in the system header files, this causes
|
||||
problems on 64-bit systems. The function returns a 64 bit pointer
|
||||
but caller see it as "int" and it's thus truncated to 32-bit
|
||||
*/
|
||||
extern char* tgoto(const char*, int, int);
|
||||
#endif
|
||||
|
||||
protected void term_move_to_line(EditLine *, int);
|
||||
protected void term_move_to_char(EditLine *, int);
|
||||
protected void term_clear_EOL(EditLine *, int);
|
||||
|
13
configure.in
13
configure.in
@ -1952,6 +1952,19 @@ else
|
||||
fi
|
||||
AC_SUBST(TERMCAP_LIB)
|
||||
|
||||
# Check if the termcap function 'tgoto' is already declared in
|
||||
# system header files or if it need to be declared locally
|
||||
AC_CHECK_DECLS(tgoto,,,[
|
||||
#ifdef HAVE_CURSES_H
|
||||
# include <curses.h>
|
||||
#elif HAVE_NCURSES_H
|
||||
# include <ncurses.h>
|
||||
#endif
|
||||
#ifdef HAVE_TERM_H
|
||||
# include <term.h>
|
||||
#endif
|
||||
])
|
||||
|
||||
LIBEDIT_LOBJECTS=""
|
||||
AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
|
||||
AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
|
||||
|
@ -1,4 +0,0 @@
|
||||
-- require r/is_debug_build.require
|
||||
--disable_query_log
|
||||
select instr(version(), "debug") > 0;
|
||||
--enable_query_log
|
@ -1,3 +1,6 @@
|
||||
# Replication tests need binlog
|
||||
source include/have_log_bin.inc;
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
4
mysql-test/include/show_binlog_events.inc
Normal file
4
mysql-test/include/show_binlog_events.inc
Normal file
@ -0,0 +1,4 @@
|
||||
--let $binlog_start=98
|
||||
--replace_column 5 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\//
|
||||
--eval show binlog events from $binlog_start
|
14
mysql-test/include/uses_vardir.inc
Normal file
14
mysql-test/include/uses_vardir.inc
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Some tests uses LOAD DATA with a relative path
|
||||
# and need to see for example ../std_data
|
||||
#
|
||||
# Also if an absolute path was used, the server might be started
|
||||
# with --secure-file-priv and wouldn't be allowed to LOAD a file
|
||||
# outside of it's vardir anyway
|
||||
#
|
||||
|
||||
|
||||
if (`select LOCATE('$MYSQLTEST_VARDIR', REPLACE(@@datadir, '\\\\', '/')) != 1`)
|
||||
{
|
||||
skip Need mysqld in MYSQLTEST_VARDIR;
|
||||
}
|
@ -596,6 +596,25 @@ sub collect_one_test_case($$$$$$$) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $tinfo->{'need_binlog'} )
|
||||
{
|
||||
if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Test need binlog";
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $::mysql_version_id >= 50100 )
|
||||
{
|
||||
# Test does not need binlog, add --skip-binlog to
|
||||
# the options used when starting it
|
||||
push(@{$tinfo->{'master_opt'}}, "--skip-log-bin");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -608,6 +627,7 @@ our @tags=
|
||||
["include/have_binlog_format_row.inc", "binlog_format", "row"],
|
||||
["include/have_binlog_format_statement.inc", "binlog_format", "stmt"],
|
||||
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"],
|
||||
["include/have_log_bin.inc", "need_binlog", 1],
|
||||
["include/big_test.inc", "big_test", 1],
|
||||
["include/have_debug.inc", "need_debug", 1],
|
||||
["include/have_ndb.inc", "ndb_test", 1],
|
||||
|
@ -903,6 +903,9 @@ sub command_line_setup () {
|
||||
$opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
|
||||
$opt_skip_ssl= 1; # Turn off use of SSL
|
||||
|
||||
# Turn off use of bin log
|
||||
push(@opt_extra_mysqld_opt, "--skip-log-bin");
|
||||
|
||||
if ( $opt_extern )
|
||||
{
|
||||
mtr_error("Can't use --extern with --embedded-server");
|
||||
|
@ -1,16 +0,0 @@
|
||||
drop table if exists t1;
|
||||
set names cp932;
|
||||
set character_set_database = cp932;
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1(f1 blob);
|
||||
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
|
||||
SET @var1= x'8300';
|
||||
EXECUTE stmt1 USING @var1;
|
||||
SHOW BINLOG EVENTS FROM 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob)
|
||||
master-bin.000001 188 Query 1 283 use `test`; INSERT INTO t1 VALUES(0x8300)
|
||||
SELECT HEX(f1) FROM t1;
|
||||
HEX(f1)
|
||||
8300
|
||||
DROP table t1;
|
@ -431,15 +431,17 @@ insert into t2 values(13491727406643098568),
|
||||
(0x8000000400000001),
|
||||
(0x8000004000000001),
|
||||
(0x8000040000000001);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
|
||||
42);
|
||||
HEX(a)
|
||||
BB3C3E98175D33C8
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(0xBB3C3E98175D33C8,
|
||||
0x7fffffffffffffff,
|
||||
0x8000000000000000,
|
||||
0x8000000000000400,
|
||||
0x8000000000000401,
|
||||
(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
|
||||
CAST(0x7fffffffffffffff AS UNSIGNED),
|
||||
CAST(0x8000000000000000 AS UNSIGNED),
|
||||
CAST(0x8000000000000400 AS UNSIGNED),
|
||||
CAST(0x8000000000000401 AS UNSIGNED),
|
||||
42);
|
||||
HEX(a)
|
||||
BB3C3E98175D33C8
|
||||
@ -447,15 +449,22 @@ BB3C3E98175D33C8
|
||||
8000000000000000
|
||||
8000000000000400
|
||||
8000000000000401
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0x7fffffffffffffff AS UNSIGNED),
|
||||
CAST(0x8000000000000001 AS UNSIGNED));
|
||||
HEX(a)
|
||||
7FFFFFFFFFFFFFFF
|
||||
8000000000000001
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0x7ffffffffffffffe AS UNSIGNED),
|
||||
CAST(0x7fffffffffffffff AS UNSIGNED));
|
||||
HEX(a)
|
||||
7FFFFFFFFFFFFFFE
|
||||
7FFFFFFFFFFFFFFF
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(0x7ffffffffffffffe,
|
||||
0x7fffffffffffffff,
|
||||
'abc');
|
||||
HEX(a)
|
||||
7FFFFFFFFFFFFFFE
|
||||
7FFFFFFFFFFFFFFF
|
||||
|
3
mysql-test/r/long_tmpdir.result
Normal file
3
mysql-test/r/long_tmpdir.result
Normal file
@ -0,0 +1,3 @@
|
||||
create view v1 as select table_name from information_schema.tables;
|
||||
drop view v1;
|
||||
End of 5.0 tests
|
@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(1)
|
||||
master-bin.000001 253 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 347 Xid 1 # COMMIT /* xid=9 */
|
||||
master-bin.000001 347 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -47,7 +47,7 @@ master-bin.000001 253 Query 1 # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 338 Query 1 # use `test`; insert into t1 values(4)
|
||||
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 616 Xid 1 # COMMIT /* xid=26 */
|
||||
master-bin.000001 616 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -74,7 +74,7 @@ master-bin.000001 338 Query 1 # use `test`; insert into t1 values(6)
|
||||
master-bin.000001 425 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 519 Query 1 # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 616 Query 1 # use `test`; insert into t1 values(7)
|
||||
master-bin.000001 703 Xid 1 # COMMIT /* xid=38 */
|
||||
master-bin.000001 703 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -101,7 +101,7 @@ insert into t2 select * from t1;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(9)
|
||||
master-bin.000001 185 Xid 1 # COMMIT /* xid=61 */
|
||||
master-bin.000001 185 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 212 Query 1 # use `test`; insert into t2 select * from t1
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -112,18 +112,18 @@ insert into t2 select * from t1;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 186 Xid 1 # COMMIT /* xid=67 */
|
||||
master-bin.000001 186 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 186 Xid 1 # COMMIT /* xid=67 */
|
||||
master-bin.000001 186 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 213 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 307 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 375 Query 1 # use `test`; insert into t1 values(11)
|
||||
master-bin.000001 463 Xid 1 # COMMIT /* xid=69 */
|
||||
master-bin.000001 463 Xid 1 # COMMIT /* XID */
|
||||
alter table t2 engine=INNODB;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -137,7 +137,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(12)
|
||||
master-bin.000001 254 Query 1 # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 348 Xid 1 # COMMIT /* xid=79 */
|
||||
master-bin.000001 348 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -161,7 +161,7 @@ show binlog events from 98;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(14)
|
||||
master-bin.000001 254 Xid 1 # COMMIT /* xid=95 */
|
||||
master-bin.000001 254 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
reset master;
|
||||
@ -182,7 +182,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 342 Xid 1 # COMMIT /* xid=106 */
|
||||
master-bin.000001 342 Xid 1 # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
alter table t2 type=MyISAM;
|
||||
@ -234,19 +234,19 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 98 Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 166 Query 1 # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 254 Query 1 # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 342 Xid 1 # COMMIT /* xid=106 */
|
||||
master-bin.000001 342 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 369 Query 1 # use `test`; delete from t1
|
||||
master-bin.000001 446 Xid 1 # COMMIT /* xid=115 */
|
||||
master-bin.000001 446 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 473 Query 1 # use `test`; delete from t2
|
||||
master-bin.000001 550 Xid 1 # COMMIT /* xid=116 */
|
||||
master-bin.000001 550 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 577 Query 1 # use `test`; alter table t2 type=MyISAM
|
||||
master-bin.000001 666 Query 1 # use `test`; insert into t1 values (1)
|
||||
master-bin.000001 754 Xid 1 # COMMIT /* xid=118 */
|
||||
master-bin.000001 754 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 781 Query 1 # use `test`; insert into t2 values (20)
|
||||
master-bin.000001 870 Query 1 # use `test`; drop table t1,t2
|
||||
master-bin.000001 949 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
|
||||
master-bin.000001 1059 Query 1 # use `test`; insert into ti values(1)
|
||||
master-bin.000001 1146 Xid 1 # COMMIT /* xid=133 */
|
||||
master-bin.000001 1146 Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 1173 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
|
||||
master-bin.000001 1283 Query 1 # use `test`; insert t1 values (1)
|
||||
master-bin.000001 1366 Query 1 # use `test`; create table t0 (n int)
|
||||
|
@ -530,23 +530,3 @@ count(*)
|
||||
drop table t3, t4|
|
||||
drop procedure bug14210|
|
||||
set @@session.max_heap_table_size=default|
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
insert into t2 values (1,1)|
|
||||
create function bug23333()
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
begin
|
||||
insert into t1 values (null);
|
||||
select count(*) from t1 into @a;
|
||||
return @a;
|
||||
end|
|
||||
reset master|
|
||||
insert into t2 values (bug23333(),1)|
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
count(*) @a
|
||||
1 1
|
||||
drop table t1, t2|
|
||||
|
20
mysql-test/r/sp_trans_log.result
Normal file
20
mysql-test/r/sp_trans_log.result
Normal file
@ -0,0 +1,20 @@
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
insert into t2 values (1,1)|
|
||||
create function bug23333()
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
begin
|
||||
insert into t1 values (null);
|
||||
select count(*) from t1 into @a;
|
||||
return @a;
|
||||
end|
|
||||
reset master|
|
||||
insert into t2 values (bug23333(),1)|
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
count(*) @a
|
||||
1 1
|
||||
drop table t1, t2|
|
@ -601,9 +601,9 @@ Warnings:
|
||||
Note 1449 There is no 'no-such-user'@'localhost' registered
|
||||
SHOW CREATE VIEW v;
|
||||
View Create View
|
||||
v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a` from `t1`
|
||||
v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1`
|
||||
Warnings:
|
||||
Note 1449 There is no 'no-such-user'@'localhost' registered
|
||||
Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
SELECT * FROM v;
|
||||
ERROR HY000: There is no 'no-such-user'@'localhost' registered
|
||||
DROP VIEW v;
|
||||
|
@ -1,3 +1,8 @@
|
||||
|
||||
# The server need to be started in $MYSQLTEST_VARDIR since it
|
||||
# uses ../std_data_ln/
|
||||
-- source include/uses_vardir.inc
|
||||
|
||||
#
|
||||
# This test is a bit tricky as we can't use backup table to overwrite an old
|
||||
# table
|
||||
|
@ -5,6 +5,7 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_bdb.inc
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
|
@ -1,5 +1,6 @@
|
||||
-- source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
###
|
||||
### bug#22725 : incorrect killed error in binlogged query
|
||||
|
@ -6,6 +6,10 @@
|
||||
-- source include/have_blackhole.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# The server need to be started in $MYSQLTEST_VARDIR since it
|
||||
# uses ../std_data_ln/
|
||||
-- source include/uses_vardir.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
@ -110,7 +114,7 @@ insert into t1 values(1);
|
||||
insert ignore into t1 values(1);
|
||||
replace into t1 values(100);
|
||||
create table t2 (a varchar(200)) engine=blackhole;
|
||||
load data infile '../std_data_ln/words.dat' into table t2;
|
||||
eval load data infile '../std_data_ln/words.dat' into table t2;
|
||||
alter table t1 add b int;
|
||||
alter table t1 drop b;
|
||||
create table t3 like t1;
|
||||
|
@ -1,33 +0,0 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_cp932.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
--character_set cp932
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
set names cp932;
|
||||
set character_set_database = cp932;
|
||||
|
||||
# Test prepared statement with 0x8300 sequence in parameter while
|
||||
# running with cp932 client character set.
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1(f1 blob);
|
||||
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
|
||||
SET @var1= x'8300';
|
||||
# TODO: Note that this doesn't actually test the code which was added for
|
||||
# bug#11338 because this syntax for prepared statements causes the PS to
|
||||
# be replicated differently than if we executed the PS from C or Java.
|
||||
# Using this syntax, variable names are inserted into the binlog instead
|
||||
# of values. The real goal of this test is to check the code that was
|
||||
# added to Item_param::query_val_str() in order to do hex encoding of
|
||||
# PS parameters when the client character set is cp932;
|
||||
# Bug#11338 has an example java program which can be used to verify this
|
||||
# code (and I have used it to test the fix) until there is some way to
|
||||
# exercise this code from mysql-test-run.
|
||||
EXECUTE stmt1 USING @var1;
|
||||
SHOW BINLOG EVENTS FROM 98;
|
||||
SELECT HEX(f1) FROM t1;
|
||||
DROP table t1;
|
||||
# end test for bug#11338
|
@ -1,5 +1,3 @@
|
||||
# Embedded server doesn't support binlog
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
--disable_warnings
|
||||
|
@ -6,7 +6,7 @@
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# And it requires InnoDB
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
|
@ -335,19 +335,28 @@ insert into t2 values(13491727406643098568),
|
||||
(0x8000004000000001),
|
||||
(0x8000040000000001);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0xBB3C3E98175D33C8, 42);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
|
||||
42);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(0xBB3C3E98175D33C8,
|
||||
0x7fffffffffffffff,
|
||||
0x8000000000000000,
|
||||
0x8000000000000400,
|
||||
0x8000000000000401,
|
||||
42);
|
||||
(CAST(0xBB3C3E98175D33C8 AS UNSIGNED),
|
||||
CAST(0x7fffffffffffffff AS UNSIGNED),
|
||||
CAST(0x8000000000000000 AS UNSIGNED),
|
||||
CAST(0x8000000000000400 AS UNSIGNED),
|
||||
CAST(0x8000000000000401 AS UNSIGNED),
|
||||
42);
|
||||
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7fffffffffffffff,0x8000000000000001);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff);
|
||||
SELECT HEX(a) FROM t2 WHERE a IN (0x7ffffffffffffffe,0x7fffffffffffffff,'abc');
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0x7fffffffffffffff AS UNSIGNED),
|
||||
CAST(0x8000000000000001 AS UNSIGNED));
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(CAST(0x7ffffffffffffffe AS UNSIGNED),
|
||||
CAST(0x7fffffffffffffff AS UNSIGNED));
|
||||
SELECT HEX(a) FROM t2 WHERE a IN
|
||||
(0x7ffffffffffffffe,
|
||||
0x7fffffffffffffff,
|
||||
'abc');
|
||||
|
||||
CREATE TABLE t3 (a BIGINT UNSIGNED);
|
||||
INSERT INTO t3 VALUES (9223372036854775551);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#######################################################################
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
#
|
||||
# Small basic test with ignore
|
||||
|
1
mysql-test/t/long_tmpdir-master.opt
Normal file
1
mysql-test/t/long_tmpdir-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--tmpdir=$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
|
3
mysql-test/t/long_tmpdir-master.sh
Normal file
3
mysql-test/t/long_tmpdir-master.sh
Normal file
@ -0,0 +1,3 @@
|
||||
d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789"
|
||||
test -d "$d" || mkdir "$d"
|
||||
rm -f "$d"/*
|
9
mysql-test/t/long_tmpdir.test
Normal file
9
mysql-test/t/long_tmpdir.test
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# Bug #29015: Stack overflow in processing temporary table name when tmpdir path
|
||||
# is long
|
||||
#
|
||||
|
||||
create view v1 as select table_name from information_schema.tables;
|
||||
drop view v1;
|
||||
|
||||
--echo End of 5.0 tests
|
@ -4,10 +4,8 @@
|
||||
# slave is always with --skip-innodb in the testsuite. I (Guilhem) however
|
||||
# did some tests manually on a slave; tables are replicated fine and
|
||||
# Exec_Master_Log_Pos advances as expected.
|
||||
-- source include/have_log_bin.inc
|
||||
# Embedded server doesn't support binlogging
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
@ -28,9 +26,7 @@ insert into t1 values(1);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=15" "xid=9"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -42,8 +38,7 @@ insert into t2 select * from t1;
|
||||
# should say some changes to non-transact1onal tables couldn't be rolled back
|
||||
rollback;
|
||||
|
||||
--replace_column 5 #
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -57,9 +52,7 @@ insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=48" "xid=26"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -75,9 +68,7 @@ insert into t1 values(7);
|
||||
commit;
|
||||
select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=70" "xid=38"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# and when ROLLBACK is not explicit?
|
||||
delete from t1;
|
||||
@ -97,8 +88,7 @@ connection con2;
|
||||
# so SHOW BINLOG EVENTS may come before con1 does the loggin. To be sure that
|
||||
# logging has been done, we use a user lock.
|
||||
select get_lock("a",10);
|
||||
--replace_column 5 #
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# and when not in a transact1on?
|
||||
delete from t1;
|
||||
@ -108,9 +98,7 @@ reset master;
|
||||
insert into t1 values(9);
|
||||
insert into t2 select * from t1;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=118" "xid=61"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Check that when the query updat1ng the MyISAM table is the first in the
|
||||
# transaction, we log it immediately.
|
||||
@ -121,16 +109,11 @@ reset master;
|
||||
insert into t1 values(10); # first make t1 non-empty
|
||||
begin;
|
||||
insert into t2 select * from t1;
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=132" "xid=67"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
insert into t1 values(11);
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=132" "xid=67" "xid=135" "xid=69"
|
||||
show binlog events from 98;
|
||||
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Check that things work like before this BEGIN/ROLLBACK code was added,
|
||||
# when t2 is INNODB
|
||||
@ -146,9 +129,7 @@ insert into t1 values(12);
|
||||
insert into t2 select * from t1;
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=154" "xid=79"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -159,8 +140,7 @@ insert into t1 values(13);
|
||||
insert into t2 select * from t1;
|
||||
rollback;
|
||||
|
||||
--replace_column 5 #
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -174,9 +154,7 @@ insert into t2 select * from t1;
|
||||
rollback to savepoint my_savepoint;
|
||||
commit;
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=186" "xid=95"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -192,9 +170,7 @@ insert into t1 values(18);
|
||||
commit;
|
||||
select a from t1 order by a; # check that savepoints work :)
|
||||
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=207" "xid=106"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
# Test for BUG#5714, where a MyISAM update in the transaction used to
|
||||
# release row-level locks in InnoDB
|
||||
@ -253,9 +229,7 @@ insert into t2 values (3);
|
||||
disconnect con2;
|
||||
connection con3;
|
||||
select get_lock("lock1",60);
|
||||
--replace_column 5 #
|
||||
--replace_result "xid=207" "xid=106" "xid=225" "xid=115" "xid=228" "xid=116" "xid=232" "xid=118" "xid=259" "xid=133"
|
||||
show binlog events from 98;
|
||||
source include/show_binlog_events.inc;
|
||||
do release_lock("lock1");
|
||||
drop table t0,t2;
|
||||
|
||||
|
@ -2,9 +2,6 @@
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# Embedded server doesn't support binlogging
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# we need this for getting fixed timestamps inside of this test
|
||||
set timestamp=1000000000;
|
||||
|
||||
|
@ -3,9 +3,6 @@
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# Embedded server doesn't support binlogging
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
@ -1,5 +1,6 @@
|
||||
# Embedded server doesn't support external clients
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
# Binlog is required
|
||||
--source include/have_log_bin.inc
|
||||
|
@ -1,3 +1,5 @@
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
connection master;
|
||||
|
@ -1,3 +1,5 @@
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
|
||||
connection master;
|
||||
|
@ -1,6 +1,8 @@
|
||||
# This test uses chmod, can't be run with root permissions
|
||||
-- source include/not_as_root.inc
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
#
|
||||
# Test is run with max_binlog_size=2048 to force automatic rotation of the
|
||||
# binary log
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Test the debugging feature "show procedure/function code <name>"
|
||||
#
|
||||
|
||||
-- source include/is_debug_build.inc
|
||||
-- source include/have_debug.inc
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists empty;
|
||||
|
@ -554,34 +554,6 @@ drop procedure bug14210|
|
||||
set @@session.max_heap_table_size=default|
|
||||
|
||||
|
||||
#
|
||||
# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
|
||||
# Bug #23333 stored function + non-transac table + transac table =
|
||||
# breaks stmt-based binlog
|
||||
# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
|
||||
#
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
|
||||
insert into t2 values (1,1)|
|
||||
|
||||
create function bug23333()
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
begin
|
||||
insert into t1 values (null);
|
||||
select count(*) from t1 into @a;
|
||||
return @a;
|
||||
end|
|
||||
|
||||
reset master|
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug23333(),1)|
|
||||
--replace_column 2 # 5 # 6 #
|
||||
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
drop table t1, t2|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
33
mysql-test/t/sp_trans_log.test
Normal file
33
mysql-test/t/sp_trans_log.test
Normal file
@ -0,0 +1,33 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
delimiter |;
|
||||
|
||||
#
|
||||
# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
|
||||
# Bug #23333 stored function + non-transac table + transac table =
|
||||
# breaks stmt-based binlog
|
||||
# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
|
||||
#
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
|
||||
|
||||
insert into t2 values (1,1)|
|
||||
|
||||
create function bug23333()
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
begin
|
||||
insert into t1 values (null);
|
||||
select count(*) from t1 into @a;
|
||||
return @a;
|
||||
end|
|
||||
|
||||
reset master|
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug23333(),1)|
|
||||
--replace_column 2 # 5 # 6 #
|
||||
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
|
||||
select count(*),@a from t1 /* must be 1,1 */|
|
||||
drop table t1, t2|
|
||||
|
@ -1,6 +1,4 @@
|
||||
# Embedded server does not support binlogging
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_log_bin.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
# Check that user variables are binlogged correctly (BUG#3875)
|
||||
create table t1 (a varchar(50));
|
||||
|
@ -87,27 +87,31 @@ my_bool my_thread_global_init(void)
|
||||
fprintf(stderr,"Can't initialize threads: error %d\n", pth_ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef NPTL_PTHREAD_EXIT_BUG
|
||||
/*
|
||||
BUG#24507: Race conditions inside current NPTL pthread_exit()
|
||||
implementation.
|
||||
|
||||
/*
|
||||
BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
|
||||
To avoid a possible segmentation fault during concurrent
|
||||
executions of pthread_exit(), a dummy thread is spawned which
|
||||
initializes internal variables of pthread lib. See bug description
|
||||
for a full explanation.
|
||||
|
||||
To avoid a possible segmentation fault during concurrent executions of
|
||||
pthread_exit(), a dummy thread is spawned which initializes internal variables
|
||||
of pthread lib. See bug description for thoroughfull explanation.
|
||||
|
||||
TODO: Remove this code when fixed versions of glibc6 are in common use.
|
||||
*/
|
||||
TODO: Remove this code when fixed versions of glibc6 are in common
|
||||
use.
|
||||
*/
|
||||
if (thd_lib_detected == THD_LIB_NPTL)
|
||||
{
|
||||
pthread_t dummy_thread;
|
||||
pthread_attr_t dummy_thread_attr;
|
||||
|
||||
pthread_t dummy_thread;
|
||||
pthread_attr_t dummy_thread_attr;
|
||||
|
||||
pthread_attr_init(&dummy_thread_attr);
|
||||
pthread_attr_setdetachstate(&dummy_thread_attr,PTHREAD_CREATE_DETACHED);
|
||||
|
||||
pthread_create(&dummy_thread,&dummy_thread_attr,nptl_pthread_exit_hack_handler,NULL);
|
||||
pthread_attr_init(&dummy_thread_attr);
|
||||
pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
pthread_create(&dummy_thread,&dummy_thread_attr,
|
||||
nptl_pthread_exit_hack_handler, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
|
||||
|
@ -416,7 +416,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
|
||||
shared_memory_base_name is unique value for each server
|
||||
unique_part is uniquel value for each object (events and file-mapping)
|
||||
*/
|
||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",NullS);
|
||||
suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", NullS);
|
||||
strmov(suffix_pos, "CONNECT_REQUEST");
|
||||
if (!(event_connect_request= OpenEvent(event_access_rights, FALSE, tmp)))
|
||||
{
|
||||
@ -470,8 +470,8 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout)
|
||||
unique_part is uniquel value for each object (events and file-mapping)
|
||||
number_of_connection is number of connection between server and client
|
||||
*/
|
||||
suffix_pos = strxmov(tmp,shared_memory_base_name,"_",connect_number_char,
|
||||
"_",NullS);
|
||||
suffix_pos = strxmov(tmp, "Global\\", shared_memory_base_name, "_", connect_number_char,
|
||||
"_", NullS);
|
||||
strmov(suffix_pos, "DATA");
|
||||
if ((handle_file_map = OpenFileMapping(FILE_MAP_WRITE,FALSE,tmp)) == NULL)
|
||||
{
|
||||
|
@ -978,14 +978,15 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
|
||||
*/
|
||||
for (i=0 ; i < acl_users.elements ; i++)
|
||||
{
|
||||
acl_user= dynamic_element(&acl_users,i,ACL_USER*);
|
||||
if ((!acl_user->user && !user[0]) ||
|
||||
(acl_user->user && strcmp(user, acl_user->user) == 0))
|
||||
ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
|
||||
if ((!acl_user_tmp->user && !user[0]) ||
|
||||
(acl_user_tmp->user && strcmp(user, acl_user_tmp->user) == 0))
|
||||
{
|
||||
if (compare_hostname(&acl_user->host, host, ip))
|
||||
if (compare_hostname(&acl_user_tmp->host, host, ip))
|
||||
{
|
||||
res= 0;
|
||||
break;
|
||||
acl_user= acl_user_tmp;
|
||||
res= 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1009,9 +1009,12 @@ static int check_connection(THD *thd)
|
||||
Old clients send null-terminated string as password; new clients send
|
||||
the size (1 byte) + string (not null-terminated). Hence in case of empty
|
||||
password both send '\0'.
|
||||
|
||||
Cast *passwd to an unsigned char, so that it doesn't extend the sign for
|
||||
*passwd > 127 and become 2**32-127 after casting to uint.
|
||||
*/
|
||||
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
|
||||
*passwd++ : strlen(passwd);
|
||||
(uchar)(*passwd++) : strlen(passwd);
|
||||
db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ?
|
||||
db + passwd_len + 1 : 0;
|
||||
uint db_len= db ? strlen(db) : 0;
|
||||
@ -1697,11 +1700,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
Old clients send null-terminated string ('\0' for empty string) for
|
||||
password. New clients send the size (1 byte) + string (not null
|
||||
terminated, so also '\0' for empty string).
|
||||
|
||||
Cast *passwd to an unsigned char, so that it doesn't extend the sign
|
||||
for *passwd > 127 and become 2**32-127 after casting to uint.
|
||||
*/
|
||||
char db_buff[NAME_LEN+1]; // buffer to store db in utf8
|
||||
char *db= passwd;
|
||||
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
|
||||
*passwd++ : strlen(passwd);
|
||||
(uchar)(*passwd++) : strlen(passwd);
|
||||
db+= passwd_len + 1;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
/* Small check for incoming packet */
|
||||
|
@ -9164,7 +9164,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
bool using_unique_constraint= 0;
|
||||
bool use_packed_rows= 0;
|
||||
bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
|
||||
char *tmpname,path[FN_REFLEN];
|
||||
char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
|
||||
byte *pos,*group_buff;
|
||||
uchar *null_flags;
|
||||
Field **reg_field, **from_field, **default_field;
|
||||
@ -9187,12 +9187,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
temp_pool_slot = bitmap_set_next(&temp_pool);
|
||||
|
||||
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
|
||||
sprintf(path, "%s_%lx_%i", tmp_file_prefix,
|
||||
current_pid, temp_pool_slot);
|
||||
sprintf(table_name, "%s_%lx_%i", tmp_file_prefix,
|
||||
current_pid, temp_pool_slot);
|
||||
else
|
||||
{
|
||||
/* if we run out of slots or we are not using tempool */
|
||||
sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
|
||||
sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
|
||||
thd->thread_id, thd->tmp_table++);
|
||||
}
|
||||
|
||||
@ -9200,7 +9200,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
No need to change table name to lower case as we are only creating
|
||||
MyISAM or HEAP tables here
|
||||
*/
|
||||
fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
|
||||
fn_format(path, table_name, mysql_tmpdir, "",
|
||||
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
|
||||
|
||||
if (group)
|
||||
{
|
||||
@ -9245,7 +9246,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
sizeof(*key_part_info)*(param->group_parts+1),
|
||||
¶m->start_recinfo,
|
||||
sizeof(*param->recinfo)*(field_count*2+4),
|
||||
&tmpname, (uint) strlen(path)+1,
|
||||
&tmppath, (uint) strlen(path)+1,
|
||||
&tmpname, (uint) strlen(table_name)+1,
|
||||
&group_buff, group && ! using_unique_constraint ?
|
||||
param->group_length : 0,
|
||||
NullS))
|
||||
@ -9263,7 +9265,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
DBUG_RETURN(NULL); /* purecov: inspected */
|
||||
}
|
||||
param->items_to_copy= copy_func;
|
||||
strmov(tmpname,path);
|
||||
strmov(tmppath, path);
|
||||
strmov(tmpname, table_name);
|
||||
/* make table according to fields */
|
||||
|
||||
bzero((char*) table,sizeof(*table));
|
||||
@ -9289,7 +9292,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
|
||||
table->s= &table->share_not_to_be_used;
|
||||
table->s->blob_field= blob_field;
|
||||
table->s->table_name= table->s->path= tmpname;
|
||||
table->s->table_name= tmpname;
|
||||
table->s->path= tmppath;
|
||||
table->s->db= "";
|
||||
table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
|
||||
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user