mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb sql/ha_ndbcluster.cc: Auto merged sql/handler.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
commit
5a442d6af6
109 changed files with 1592 additions and 543 deletions
|
|
@ -27,6 +27,7 @@ bar@deer.(none)
|
|||
bar@gw.udmsearch.izhnet.ru
|
||||
bar@mysql.com
|
||||
bar@noter.intranet.mysql.r18.ru
|
||||
bell@51.0.168.192.in-addr.arpa
|
||||
bell@laptop.sanja.is.com.ua
|
||||
bell@sanja.is.com.ua
|
||||
bk@admin.bk
|
||||
|
|
|
|||
|
|
@ -2926,9 +2926,9 @@ com_status(String *buffer __attribute__((unused)),
|
|||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
{
|
||||
tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[0] : "");
|
||||
tee_fprintf(stdout, "Server characterset:\t%s\n", cur[2] ? cur[2] : "");
|
||||
tee_fprintf(stdout, "Db characterset:\t%s\n", cur[3] ? cur[3] : "");
|
||||
tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[2] : "");
|
||||
tee_fprintf(stdout, "Client characterset:\t%s\n", cur[0] ? cur[0] : "");
|
||||
tee_fprintf(stdout, "Conn. characterset:\t%s\n", cur[1] ? cur[1] : "");
|
||||
}
|
||||
mysql_free_result(result);
|
||||
|
|
|
|||
|
|
@ -493,7 +493,8 @@ static void write_header(FILE *sql_file, char *db_name)
|
|||
");
|
||||
}
|
||||
fprintf(sql_file,
|
||||
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n",
|
||||
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n"
|
||||
"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n",
|
||||
path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
|
||||
compatible_mode_normal_str);
|
||||
check_io(sql_file);
|
||||
|
|
@ -522,6 +523,8 @@ static void write_footer(FILE *sql_file)
|
|||
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"
|
||||
"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
|
||||
"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
|
||||
fprintf(sql_file,
|
||||
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
|
||||
fputs("\n", sql_file);
|
||||
check_io(sql_file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,25 +120,33 @@ int main(int argc, char **argv)
|
|||
int count, error;
|
||||
char **load_default_groups, *tmp_arguments[2],
|
||||
**argument, **arguments;
|
||||
char *defaults, *extra_defaults;
|
||||
MY_INIT(argv[0]);
|
||||
|
||||
get_defaults_files(argc, argv, &defaults, &extra_defaults);
|
||||
|
||||
/*
|
||||
** Check out the args
|
||||
*/
|
||||
if (get_options(&argc,&argv))
|
||||
exit(1);
|
||||
if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*),
|
||||
MYF(MY_WME))))
|
||||
exit(1);
|
||||
if (get_options(&argc,&argv))
|
||||
exit(1);
|
||||
|
||||
for (count=0; *argv ; argv++,count++)
|
||||
load_default_groups[count]= *argv;
|
||||
load_default_groups[count]=0;
|
||||
|
||||
count=1;
|
||||
count=0;
|
||||
arguments=tmp_arguments;
|
||||
arguments[0]=my_progname;
|
||||
arguments[1]=0;
|
||||
arguments[count++]=my_progname;
|
||||
if (extra_defaults)
|
||||
arguments[count++]= extra_defaults;
|
||||
if (defaults)
|
||||
arguments[count++]= defaults;
|
||||
arguments[count]= 0;
|
||||
|
||||
if ((error= load_defaults(config_file, (const char **) load_default_groups,
|
||||
&count, &arguments)))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -245,16 +245,17 @@ int main(int argc,char *argv[])
|
|||
msg = strerror(code);
|
||||
|
||||
/*
|
||||
Don't print message for not existing error messages or for
|
||||
unknown errors. We test for 'Uknown Errors' just as an
|
||||
extra safety for Netware
|
||||
We don't print the OS error message if it is the same as the
|
||||
unknown_error message we retrieved above, or it starts with
|
||||
'Unknown Error' (without regard to case).
|
||||
*/
|
||||
if (msg && strcmp(msg, "Unknown Error") &&
|
||||
if (msg &&
|
||||
my_strnncoll(&my_charset_latin1, msg, 13, "Unknown Error", 13) &&
|
||||
(!unknown_error || strcmp(msg, unknown_error)))
|
||||
{
|
||||
found=1;
|
||||
if (verbose)
|
||||
printf("Error code %3d: %s\n",code,msg);
|
||||
printf("OS error code %3d: %s\n",code,msg);
|
||||
else
|
||||
puts(msg);
|
||||
}
|
||||
|
|
@ -269,7 +270,7 @@ int main(int argc,char *argv[])
|
|||
else
|
||||
{
|
||||
if (verbose)
|
||||
printf("MySQL error: %3d = %s\n",code,msg);
|
||||
printf("MySQL error code %3d: %s\n",code,msg);
|
||||
else
|
||||
puts(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -804,8 +804,13 @@ my_bool my_gethwaddr(uchar *to);
|
|||
#endif
|
||||
|
||||
#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
|
||||
#ifdef HAVE_GETPAGESIZE
|
||||
#define my_getpagesize() getpagesize()
|
||||
#define my_munmap(a,b) munmap(a,b)
|
||||
#else
|
||||
/* qnx ? */
|
||||
#define my_getpagesize() 8192
|
||||
#endif
|
||||
#define my_munmap(a,b) munmap((char*)(a),(b))
|
||||
|
||||
#else
|
||||
/* not a complete set of mmap() flags, but only those that nesessary */
|
||||
|
|
|
|||
|
|
@ -434,7 +434,19 @@ trx_lists_init_at_db_start(void)
|
|||
commit or abort decision from MySQL */
|
||||
|
||||
if (undo->state == TRX_UNDO_PREPARED) {
|
||||
trx->conc_state = TRX_PREPARED;
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Transaction %lu %lu was in the XA prepared state. We change it to\n"
|
||||
"InnoDB: the 'active' state, so that InnoDB's true-and-tested crash\n"
|
||||
"InnoDB: recovery will roll it back. If mysqld refuses to start after\n"
|
||||
"InnoDB: this, you may be able to resolve the problem by moving the binlog\n"
|
||||
"InnoDB: files to a safe place, and deleting all binlog files and the binlog\n"
|
||||
"InnoDB: .index file from the datadir.\n", ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id));
|
||||
|
||||
/* trx->conc_state = TRX_PREPARED; */
|
||||
trx->conc_state =
|
||||
TRX_ACTIVE;
|
||||
} else {
|
||||
trx->conc_state =
|
||||
TRX_COMMITTED_IN_MEMORY;
|
||||
|
|
@ -490,8 +502,20 @@ trx_lists_init_at_db_start(void)
|
|||
commit or abort decision from MySQL */
|
||||
|
||||
if (undo->state == TRX_UNDO_PREPARED) {
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Transaction %lu %lu was in the XA prepared state. We change it to\n"
|
||||
"InnoDB: the 'active' state, so that InnoDB's true-and-tested crash\n"
|
||||
"InnoDB: recovery will roll it back. If mysqld refuses to start after\n"
|
||||
"InnoDB: this, you may be able to resolve the problem by moving the binlog\n"
|
||||
"InnoDB: files to a safe place, and deleting all binlog files and the binlog\n"
|
||||
"InnoDB: .index file from the datadir.\n", ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id));
|
||||
|
||||
/* trx->conc_state = TRX_PREPARED; */
|
||||
trx->conc_state =
|
||||
TRX_PREPARED;
|
||||
TRX_ACTIVE;
|
||||
|
||||
} else {
|
||||
trx->conc_state =
|
||||
TRX_COMMITTED_IN_MEMORY;
|
||||
|
|
@ -1848,11 +1872,12 @@ trx_recover_for_mysql(
|
|||
ulint len) /* in: number of slots in xid_list */
|
||||
{
|
||||
trx_t* trx;
|
||||
int num_of_transactions = 0;
|
||||
int count = 0;
|
||||
|
||||
ut_ad(xid_list);
|
||||
ut_ad(len);
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Starting recovery for XA transactions...\n");
|
||||
|
||||
|
|
@ -1866,20 +1891,29 @@ trx_recover_for_mysql(
|
|||
|
||||
while (trx) {
|
||||
if (trx->conc_state == TRX_PREPARED) {
|
||||
xid_list[num_of_transactions] = trx->xid;
|
||||
xid_list[count].formatID = trx->xid.formatID;
|
||||
xid_list[count].gtrid_length = trx->xid.gtrid_length;
|
||||
xid_list[count].bqual_length = trx->xid.bqual_length;
|
||||
|
||||
memcpy(xid_list[count].data,
|
||||
trx->xid.data,
|
||||
trx->xid.gtrid_length +
|
||||
trx->xid.bqual_length);
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Transaction %lu %lu in prepared state after recovery\n",
|
||||
(ulong) ut_dulint_get_high(trx->id),
|
||||
(ulong) ut_dulint_get_low(trx->id));
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Transaction contains changes to %lu rows\n",
|
||||
(ulong)ut_conv_dulint_to_longlong(trx->undo_no));
|
||||
|
||||
num_of_transactions++;
|
||||
count++;
|
||||
|
||||
if ((uint)num_of_transactions == len ) {
|
||||
if ((uint)count == len ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1889,11 +1923,12 @@ trx_recover_for_mysql(
|
|||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: %d transactions in prepare state after recovery\n",
|
||||
num_of_transactions);
|
||||
count);
|
||||
|
||||
return (num_of_transactions);
|
||||
return (count);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
|||
|
|
@ -537,7 +537,7 @@ trx_undo_header_create(
|
|||
/* If X/Open XID exits in the log header we store a
|
||||
flag of it in upper byte of dict operation flag. */
|
||||
|
||||
if (xid != NULL || xid->formatID != -1) {
|
||||
if (xid != NULL && xid->formatID != -1) {
|
||||
mach_write_to_1(log_hdr + TRX_UNDO_XID_EXISTS, TRUE);
|
||||
} else {
|
||||
mach_write_to_1(log_hdr + TRX_UNDO_XID_EXISTS, FALSE);
|
||||
|
|
|
|||
|
|
@ -450,6 +450,7 @@ while test $# -gt 0; do
|
|||
--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace"
|
||||
EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \
|
||||
--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace"
|
||||
EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace"
|
||||
;;
|
||||
--fast)
|
||||
FAST_START=1
|
||||
|
|
@ -689,7 +690,7 @@ then
|
|||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
|
||||
fi
|
||||
|
||||
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent"
|
||||
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT"
|
||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
|
||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
|
||||
|
|
|
|||
|
|
@ -102,3 +102,10 @@ select * from t1 procedure analyse();
|
|||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL
|
||||
drop table t1;
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
select * from t1 procedure analyse();
|
||||
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
|
||||
test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.302500000 ENUM('1.1','2.2') NOT NULL
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -187,3 +187,19 @@ timediff(cast('2004-12-30 12:00:00' as time), '12:00:00')
|
|||
select timediff(cast('1 12:00:00' as time), '12:00:00');
|
||||
timediff(cast('1 12:00:00' as time), '12:00:00')
|
||||
24:00:00
|
||||
select cast('1.2' as decimal(3,2));
|
||||
cast('1.2' as decimal(3,2))
|
||||
1.20
|
||||
select 1e18 * cast('1.2' as decimal(3,2));
|
||||
1e18 * cast('1.2' as decimal(3,2))
|
||||
1.2e+18
|
||||
select cast(cast('1.2' as decimal(3,2)) as signed);
|
||||
cast(cast('1.2' as decimal(3,2)) as signed)
|
||||
1
|
||||
set @v1=1e18;
|
||||
select cast(@v1 as decimal(22, 2));
|
||||
cast(@v1 as decimal(22, 2))
|
||||
1000000000000000000.00
|
||||
select cast(-1e18 as decimal(22,2));
|
||||
cast(-1e18 as decimal(22,2))
|
||||
-1000000000000000000.00
|
||||
|
|
|
|||
|
|
@ -325,3 +325,8 @@ latin1_bin 6109
|
|||
latin1_bin 61
|
||||
latin1_bin 6120
|
||||
drop table t1;
|
||||
CREATE TABLE „a (a int);
|
||||
ERROR 42000: 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 '„a (a int)' at line 1
|
||||
SELECT '„a' as str;
|
||||
str
|
||||
„a
|
||||
|
|
|
|||
|
|
@ -861,3 +861,6 @@ user c
|
|||
one <one>
|
||||
two <two>
|
||||
DROP TABLE t1;
|
||||
select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8);
|
||||
convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8)
|
||||
1
|
||||
|
|
|
|||
|
|
@ -344,3 +344,22 @@ INSERT INTO t1 VALUES ('root','localhost'), ('root','%');
|
|||
SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c;
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
DROP TABLE t1;
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
insert into t1 values(1),(1);
|
||||
insert into t2 values(2),(2);
|
||||
insert into t3 values(3),(3);
|
||||
select * from t1 union distinct select * from t2 union all select * from t3;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
3
|
||||
select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
3
|
||||
drop table t1, t2, t3;
|
||||
|
|
|
|||
|
|
@ -769,3 +769,38 @@ show columns from t2;
|
|||
Field Type Null Key Default Extra
|
||||
f2 datetime NO 0000-00-00 00:00:00
|
||||
drop table t2, t1;
|
||||
create table t2 (ff double);
|
||||
insert into t2 values (2.2);
|
||||
select cast(sum(distinct ff) as decimal(5,2)) from t2;
|
||||
cast(sum(distinct ff) as decimal(5,2))
|
||||
2.20
|
||||
select cast(sum(distinct ff) as signed) from t2;
|
||||
cast(sum(distinct ff) as signed)
|
||||
2
|
||||
select cast(variance(ff) as decimal(10,3)) from t2;
|
||||
cast(variance(ff) as decimal(10,3))
|
||||
0.000
|
||||
select cast(min(ff) as decimal(5,2)) from t2;
|
||||
cast(min(ff) as decimal(5,2))
|
||||
2.20
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
select cast(sum(distinct df) as signed) from t1;
|
||||
cast(sum(distinct df) as signed)
|
||||
3
|
||||
select cast(min(df) as signed) from t1;
|
||||
cast(min(df) as signed)
|
||||
0
|
||||
select 1e8 * sum(distinct df) from t1;
|
||||
1e8 * sum(distinct df)
|
||||
330000000
|
||||
select 1e8 * min(df) from t1;
|
||||
1e8 * min(df)
|
||||
110000000
|
||||
create table t3 (ifl int);
|
||||
insert into t3 values(1), (2);
|
||||
select cast(min(ifl) as decimal(5,2)) from t3;
|
||||
cast(min(ifl) as decimal(5,2))
|
||||
1.00
|
||||
drop table t1, t2, t3;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 ref key1 key1 4 const 100 Using where
|
||||
explain select * from t1 where pk1 < 7500 and key1 = 10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL 38 Using intersect(key1,PRIMARY); Using where
|
||||
1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using where
|
||||
explain select * from t1 where pktail1ok=1 and key1=10;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge key1,pktail1ok key1,pktail1ok 4,4 NULL 1 Using intersect(key1,pktail1ok); Using where
|
||||
|
|
|
|||
|
|
@ -1798,3 +1798,5 @@ Variable_name Value
|
|||
innodb_thread_sleep_delay 10000
|
||||
create table t1 (v varchar(16384)) engine=innodb;
|
||||
ERROR 42000: Column length too big for column 'v' (max = 255); use BLOB instead
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
ERROR 42000: The storage engine for the table doesn't support BIT FIELD
|
||||
|
|
|
|||
|
|
@ -31,3 +31,20 @@ select 5'abcd'
|
|||
select 'finish';
|
||||
finish
|
||||
finish
|
||||
flush status;
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
select * from t1 where i = 1;
|
||||
insert into t1 values (2),(3),(4);
|
||||
select * from t1 where i = 2;
|
||||
select * from t1 where i = 3||||
|
||||
i
|
||||
1
|
||||
i
|
||||
2
|
||||
i
|
||||
3
|
||||
show status like 'Slow_queries'||||
|
||||
Variable_name Value
|
||||
Slow_queries 2
|
||||
drop table t1||||
|
||||
|
|
|
|||
|
|
@ -1150,3 +1150,15 @@ drop table t1;
|
|||
set storage_engine=MyISAM;
|
||||
create table t1 (v varchar(65535));
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
create table t1 (a int) engine=myisam;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Error 2 Can't find file: 't1' (errno: 2)
|
||||
create table t1 (a int) engine=myisam;
|
||||
drop table t1;
|
||||
Got one of the listed errors
|
||||
create table t1 (a int) engine=myisam;
|
||||
drop table t1;
|
||||
Got one of the listed errors
|
||||
drop table t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) default NULL,
|
||||
|
|
@ -83,10 +84,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
CREATE TABLE `t1` (
|
||||
`a` decimal(10,5) default NULL,
|
||||
`b` float default NULL
|
||||
|
|
@ -97,6 +100,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a int, b text, c varchar(3));
|
||||
|
|
@ -153,6 +157,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` varchar(255) default NULL
|
||||
|
|
@ -172,6 +177,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
|
|
@ -179,6 +185,7 @@ INSERT INTO t1 VALUES (1), (2);
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -194,10 +201,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -213,6 +222,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create table ```a` (i int);
|
||||
|
|
@ -229,6 +239,7 @@ create table t1(a int);
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -246,10 +257,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1";
|
||||
CREATE TABLE "t1" (
|
||||
"a" int(11) default NULL
|
||||
|
|
@ -264,6 +277,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
set global sql_mode='ANSI_QUOTES';
|
||||
|
||||
|
|
@ -274,6 +288,7 @@ set global sql_mode='ANSI_QUOTES';
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -291,10 +306,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS "t1";
|
||||
CREATE TABLE "t1" (
|
||||
"a" int(11) default NULL
|
||||
|
|
@ -309,6 +326,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
set global sql_mode='';
|
||||
drop table t1;
|
||||
|
|
@ -320,6 +338,7 @@ insert into t1 values (1),(2),(3);
|
|||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -330,6 +349,7 @@ CREATE TABLE `t1` (
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
1
|
||||
2
|
||||
|
|
@ -345,6 +365,7 @@ create view v1 as select * from t1;
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -365,6 +386,7 @@ CREATE ALGORITHM=UNDEFINED VIEW `test`.`v1` AS select `test`.`t1`.`a` AS `a` fro
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
|
@ -376,6 +398,7 @@ drop table t1;
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
|
||||
|
||||
|
|
@ -387,6 +410,7 @@ USE `test`;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
create database mysqldump_test_db character set latin2 collate latin2_bin;
|
||||
|
||||
|
|
@ -397,6 +421,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
|
||||
|
||||
|
|
@ -408,6 +433,7 @@ USE `mysqldump_test_db`;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop database mysqldump_test_db;
|
||||
CREATE TABLE t1 (a CHAR(10));
|
||||
|
|
@ -420,6 +446,7 @@ INSERT INTO t1 VALUES (_latin1 '
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
|
|
@ -438,10 +465,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
|
|
@ -457,10 +486,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
|
|
@ -476,10 +507,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
|
|
@ -495,10 +528,12 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` char(10) default NULL
|
||||
|
|
@ -514,6 +549,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
|
|
@ -528,6 +564,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
|
|||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` int(11) default NULL
|
||||
|
|
@ -546,6 +583,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ select * from t4;
|
|||
ERROR 42S02: Table 'test.t4' doesn't exist
|
||||
drop table if exists t4;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't4'
|
||||
Error 155 Table 'test.t4' doesn't exist
|
||||
drop table t5;
|
||||
ERROR 42S02: Unknown table 't5'
|
||||
drop table if exists t5;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
drop table if exists t5, t6, t7, t8;
|
||||
drop database if exists mysqltest ;
|
||||
drop database if exists client_test_db;
|
||||
drop database if exists testtets;
|
||||
drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
|
||||
drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|||
start slave;
|
||||
create table t1 (a int) engine=myisam;
|
||||
flush tables;
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Error 2 Can't find file: 't1' (errno: 2)
|
||||
create table t1 (a int, unique(a)) engine=myisam;
|
||||
set sql_log_bin=0;
|
||||
insert into t1 values(2);
|
||||
|
|
|
|||
|
|
@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000;
|
|||
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
drop table t1;
|
||||
create table `t1` (
|
||||
`pk` varchar(10) not null default '',
|
||||
primary key (`pk`)
|
||||
) engine=myisam default charset=latin1;
|
||||
set @p=_latin1 'test';
|
||||
update t1 set pk='test' where pk=@p;
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -92,3 +92,120 @@ count(*)
|
|||
100
|
||||
unlock tables;
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
slave stop;
|
||||
reset master;
|
||||
create table t1 (n int) engine=innodb;
|
||||
begin;
|
||||
commit;
|
||||
drop table t1;
|
||||
show binlog events in 'master-bin.000001';
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 96 Query 1 197 use `test`; create table t1 (n int) engine=innodb
|
||||
master-bin.000001 197 Query 1 266 use `test`; BEGIN
|
||||
master-bin.000001 266 Query 1 94 use `test`; insert into t1 values(100 + 4)
|
||||
master-bin.000001 360 Query 1 187 use `test`; insert into t1 values(99 + 4)
|
||||
master-bin.000001 453 Query 1 280 use `test`; insert into t1 values(98 + 4)
|
||||
master-bin.000001 546 Query 1 373 use `test`; insert into t1 values(97 + 4)
|
||||
master-bin.000001 639 Query 1 466 use `test`; insert into t1 values(96 + 4)
|
||||
master-bin.000001 732 Query 1 559 use `test`; insert into t1 values(95 + 4)
|
||||
master-bin.000001 825 Query 1 652 use `test`; insert into t1 values(94 + 4)
|
||||
master-bin.000001 918 Query 1 745 use `test`; insert into t1 values(93 + 4)
|
||||
master-bin.000001 1011 Query 1 838 use `test`; insert into t1 values(92 + 4)
|
||||
master-bin.000001 1104 Query 1 931 use `test`; insert into t1 values(91 + 4)
|
||||
master-bin.000001 1197 Query 1 1024 use `test`; insert into t1 values(90 + 4)
|
||||
master-bin.000001 1290 Query 1 1117 use `test`; insert into t1 values(89 + 4)
|
||||
master-bin.000001 1383 Query 1 1210 use `test`; insert into t1 values(88 + 4)
|
||||
master-bin.000001 1476 Query 1 1303 use `test`; insert into t1 values(87 + 4)
|
||||
master-bin.000001 1569 Query 1 1396 use `test`; insert into t1 values(86 + 4)
|
||||
master-bin.000001 1662 Query 1 1489 use `test`; insert into t1 values(85 + 4)
|
||||
master-bin.000001 1755 Query 1 1582 use `test`; insert into t1 values(84 + 4)
|
||||
master-bin.000001 1848 Query 1 1675 use `test`; insert into t1 values(83 + 4)
|
||||
master-bin.000001 1941 Query 1 1768 use `test`; insert into t1 values(82 + 4)
|
||||
master-bin.000001 2034 Query 1 1861 use `test`; insert into t1 values(81 + 4)
|
||||
master-bin.000001 2127 Query 1 1954 use `test`; insert into t1 values(80 + 4)
|
||||
master-bin.000001 2220 Query 1 2047 use `test`; insert into t1 values(79 + 4)
|
||||
master-bin.000001 2313 Query 1 2140 use `test`; insert into t1 values(78 + 4)
|
||||
master-bin.000001 2406 Query 1 2233 use `test`; insert into t1 values(77 + 4)
|
||||
master-bin.000001 2499 Query 1 2326 use `test`; insert into t1 values(76 + 4)
|
||||
master-bin.000001 2592 Query 1 2419 use `test`; insert into t1 values(75 + 4)
|
||||
master-bin.000001 2685 Query 1 2512 use `test`; insert into t1 values(74 + 4)
|
||||
master-bin.000001 2778 Query 1 2605 use `test`; insert into t1 values(73 + 4)
|
||||
master-bin.000001 2871 Query 1 2698 use `test`; insert into t1 values(72 + 4)
|
||||
master-bin.000001 2964 Query 1 2791 use `test`; insert into t1 values(71 + 4)
|
||||
master-bin.000001 3057 Query 1 2884 use `test`; insert into t1 values(70 + 4)
|
||||
master-bin.000001 3150 Query 1 2977 use `test`; insert into t1 values(69 + 4)
|
||||
master-bin.000001 3243 Query 1 3070 use `test`; insert into t1 values(68 + 4)
|
||||
master-bin.000001 3336 Query 1 3163 use `test`; insert into t1 values(67 + 4)
|
||||
master-bin.000001 3429 Query 1 3256 use `test`; insert into t1 values(66 + 4)
|
||||
master-bin.000001 3522 Query 1 3349 use `test`; insert into t1 values(65 + 4)
|
||||
master-bin.000001 3615 Query 1 3442 use `test`; insert into t1 values(64 + 4)
|
||||
master-bin.000001 3708 Query 1 3535 use `test`; insert into t1 values(63 + 4)
|
||||
master-bin.000001 3801 Query 1 3628 use `test`; insert into t1 values(62 + 4)
|
||||
master-bin.000001 3894 Query 1 3721 use `test`; insert into t1 values(61 + 4)
|
||||
master-bin.000001 3987 Query 1 3814 use `test`; insert into t1 values(60 + 4)
|
||||
master-bin.000001 4080 Query 1 3907 use `test`; insert into t1 values(59 + 4)
|
||||
master-bin.000001 4173 Query 1 4000 use `test`; insert into t1 values(58 + 4)
|
||||
master-bin.000001 4266 Query 1 4093 use `test`; insert into t1 values(57 + 4)
|
||||
master-bin.000001 4359 Query 1 4186 use `test`; insert into t1 values(56 + 4)
|
||||
master-bin.000001 4452 Query 1 4279 use `test`; insert into t1 values(55 + 4)
|
||||
master-bin.000001 4545 Query 1 4372 use `test`; insert into t1 values(54 + 4)
|
||||
master-bin.000001 4638 Query 1 4465 use `test`; insert into t1 values(53 + 4)
|
||||
master-bin.000001 4731 Query 1 4558 use `test`; insert into t1 values(52 + 4)
|
||||
master-bin.000001 4824 Query 1 4651 use `test`; insert into t1 values(51 + 4)
|
||||
master-bin.000001 4917 Query 1 4744 use `test`; insert into t1 values(50 + 4)
|
||||
master-bin.000001 5010 Query 1 4837 use `test`; insert into t1 values(49 + 4)
|
||||
master-bin.000001 5103 Query 1 4930 use `test`; insert into t1 values(48 + 4)
|
||||
master-bin.000001 5196 Query 1 5023 use `test`; insert into t1 values(47 + 4)
|
||||
master-bin.000001 5289 Query 1 5116 use `test`; insert into t1 values(46 + 4)
|
||||
master-bin.000001 5382 Query 1 5209 use `test`; insert into t1 values(45 + 4)
|
||||
master-bin.000001 5475 Query 1 5302 use `test`; insert into t1 values(44 + 4)
|
||||
master-bin.000001 5568 Query 1 5395 use `test`; insert into t1 values(43 + 4)
|
||||
master-bin.000001 5661 Query 1 5488 use `test`; insert into t1 values(42 + 4)
|
||||
master-bin.000001 5754 Query 1 5581 use `test`; insert into t1 values(41 + 4)
|
||||
master-bin.000001 5847 Query 1 5674 use `test`; insert into t1 values(40 + 4)
|
||||
master-bin.000001 5940 Query 1 5767 use `test`; insert into t1 values(39 + 4)
|
||||
master-bin.000001 6033 Query 1 5860 use `test`; insert into t1 values(38 + 4)
|
||||
master-bin.000001 6126 Query 1 5953 use `test`; insert into t1 values(37 + 4)
|
||||
master-bin.000001 6219 Query 1 6046 use `test`; insert into t1 values(36 + 4)
|
||||
master-bin.000001 6312 Query 1 6139 use `test`; insert into t1 values(35 + 4)
|
||||
master-bin.000001 6405 Query 1 6232 use `test`; insert into t1 values(34 + 4)
|
||||
master-bin.000001 6498 Query 1 6325 use `test`; insert into t1 values(33 + 4)
|
||||
master-bin.000001 6591 Query 1 6418 use `test`; insert into t1 values(32 + 4)
|
||||
master-bin.000001 6684 Query 1 6511 use `test`; insert into t1 values(31 + 4)
|
||||
master-bin.000001 6777 Query 1 6604 use `test`; insert into t1 values(30 + 4)
|
||||
master-bin.000001 6870 Query 1 6697 use `test`; insert into t1 values(29 + 4)
|
||||
master-bin.000001 6963 Query 1 6790 use `test`; insert into t1 values(28 + 4)
|
||||
master-bin.000001 7056 Query 1 6883 use `test`; insert into t1 values(27 + 4)
|
||||
master-bin.000001 7149 Query 1 6976 use `test`; insert into t1 values(26 + 4)
|
||||
master-bin.000001 7242 Query 1 7069 use `test`; insert into t1 values(25 + 4)
|
||||
master-bin.000001 7335 Query 1 7162 use `test`; insert into t1 values(24 + 4)
|
||||
master-bin.000001 7428 Query 1 7255 use `test`; insert into t1 values(23 + 4)
|
||||
master-bin.000001 7521 Query 1 7348 use `test`; insert into t1 values(22 + 4)
|
||||
master-bin.000001 7614 Query 1 7441 use `test`; insert into t1 values(21 + 4)
|
||||
master-bin.000001 7707 Query 1 7534 use `test`; insert into t1 values(20 + 4)
|
||||
master-bin.000001 7800 Query 1 7627 use `test`; insert into t1 values(19 + 4)
|
||||
master-bin.000001 7893 Query 1 7720 use `test`; insert into t1 values(18 + 4)
|
||||
master-bin.000001 7986 Query 1 7813 use `test`; insert into t1 values(17 + 4)
|
||||
master-bin.000001 8079 Query 1 7906 use `test`; insert into t1 values(16 + 4)
|
||||
master-bin.000001 8172 Query 1 7999 use `test`; insert into t1 values(15 + 4)
|
||||
master-bin.000001 8265 Query 1 8092 use `test`; insert into t1 values(14 + 4)
|
||||
master-bin.000001 8358 Query 1 8185 use `test`; insert into t1 values(13 + 4)
|
||||
master-bin.000001 8451 Query 1 8278 use `test`; insert into t1 values(12 + 4)
|
||||
master-bin.000001 8544 Query 1 8371 use `test`; insert into t1 values(11 + 4)
|
||||
master-bin.000001 8637 Query 1 8464 use `test`; insert into t1 values(10 + 4)
|
||||
master-bin.000001 8730 Query 1 8556 use `test`; insert into t1 values(9 + 4)
|
||||
master-bin.000001 8822 Query 1 8648 use `test`; insert into t1 values(8 + 4)
|
||||
master-bin.000001 8914 Query 1 8740 use `test`; insert into t1 values(7 + 4)
|
||||
master-bin.000001 9006 Query 1 8832 use `test`; insert into t1 values(6 + 4)
|
||||
master-bin.000001 9098 Query 1 8924 use `test`; insert into t1 values(5 + 4)
|
||||
master-bin.000001 9190 Query 1 9016 use `test`; insert into t1 values(4 + 4)
|
||||
master-bin.000001 9282 Query 1 9108 use `test`; insert into t1 values(3 + 4)
|
||||
master-bin.000001 9374 Query 1 9200 use `test`; insert into t1 values(2 + 4)
|
||||
master-bin.000001 9466 Query 1 9292 use `test`; insert into t1 values(1 + 4)
|
||||
master-bin.000001 9558 Xid 1 9319 COMMIT /* xid=146 */
|
||||
master-bin.000001 9585 Rotate 1 9629 master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002';
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000002 4 Format_desc 1 96 Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000002 96 Query 1 173 use `test`; drop table t1
|
||||
|
|
|
|||
|
|
@ -852,8 +852,8 @@ NULL NULL
|
|||
3.40282e+38 0
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
|
||||
INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
|
||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
||||
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
|
||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308');
|
||||
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
||||
INSERT INTO t1 (col1) VALUES (+1.7E+309);
|
||||
Got one of the listed errors
|
||||
|
|
@ -864,7 +864,7 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1
|
|||
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
|
||||
ERROR 22003: Out of range value adjusted for column 'col2' at row 1
|
||||
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
|
||||
ERROR 22003: Out of range value adjusted for column 'col1' at row 2
|
||||
ERROR 22003: Out of range value adjusted for column 'col1' at row 3
|
||||
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
|
||||
ERROR 22012: Division by 0
|
||||
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
|
||||
|
|
@ -890,9 +890,11 @@ Warning 1264 Out of range value adjusted for column 'col2' at row 1
|
|||
Warning 1264 Out of range value adjusted for column 'col2' at row 1
|
||||
SELECT * FROM t1;
|
||||
col1 col2
|
||||
-2.2e-307 0
|
||||
0 0
|
||||
1e-303 0
|
||||
1.7e+308 1.7e+308
|
||||
-2.2e-307 0
|
||||
0 0
|
||||
-2e-307 0
|
||||
1.7e+308 1.7e+308
|
||||
0 NULL
|
||||
2 NULL
|
||||
|
|
|
|||
|
|
@ -2276,3 +2276,39 @@ pass userid parentid parentgroup childid groupname grouptypeid crse categoryid c
|
|||
1 5141 12 group2 12 group2 5 1 2 88 Oct04
|
||||
1 5141 12 group2 12 group2 5 1 2 89 Oct04
|
||||
drop table if exists t1, t2, t3, t4, t5;
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
select * from t1 where df <= all (select avg(df) from t1 group by df);
|
||||
df
|
||||
1.1
|
||||
select * from t1 where df >= all (select avg(df) from t1 group by df);
|
||||
df
|
||||
2.2
|
||||
drop table t1;
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
select 1.1 * exists(select * from t1);
|
||||
1.1 * exists(select * from t1)
|
||||
1.1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
grp int(11) default NULL,
|
||||
a decimal(10,2) default NULL);
|
||||
insert into t1 values (1, 1), (2, 2), (2, 3), (3, 4), (3, 5), (3, 6), (NULL, NULL);
|
||||
select * from t1;
|
||||
grp a
|
||||
1 1.00
|
||||
2 2.00
|
||||
2 3.00
|
||||
3 4.00
|
||||
3 5.00
|
||||
3 6.00
|
||||
NULL NULL
|
||||
select min(a) from t1 group by grp;
|
||||
min(a)
|
||||
NULL
|
||||
1.00
|
||||
2.00
|
||||
4.00
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ t1 CREATE TABLE `t1` (
|
|||
`a` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
ERROR 42000: The storage engine for the table doesn't support BIT FIELD
|
||||
create table t1 (a bit(64));
|
||||
insert into t1 values
|
||||
(b'1111111111111111111111111111111111111111111111111111111111111111'),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
SET SQL_WARNINGS=1;
|
||||
CREATE TABLE t1 (
|
||||
id int(11) NOT NULL auto_increment,
|
||||
|
|
@ -677,3 +677,19 @@ a
|
|||
9999.999
|
||||
0000.000
|
||||
drop table t1;
|
||||
CREATE TABLE t1
|
||||
(EMPNUM CHAR(3) NOT NULL,
|
||||
HOURS DECIMAL(5));
|
||||
CREATE TABLE t2
|
||||
(EMPNUM CHAR(3) NOT NULL,
|
||||
HOURS BIGINT);
|
||||
INSERT INTO t1 VALUES ('E1',40);
|
||||
INSERT INTO t1 VALUES ('E8',NULL);
|
||||
INSERT INTO t2 VALUES ('E1',40);
|
||||
SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t2);
|
||||
EMPNUM
|
||||
E1
|
||||
SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1);
|
||||
EMPNUM
|
||||
E1
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,12 @@ SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
|||
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
||||
0.001e+1 0.001e-1 -0.001e+01 -0.001e-01
|
||||
0.01 0.0001 -0.01 -0.0001
|
||||
SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0;
|
||||
123.23E+02 -123.23E-02 "123.23E+02"+0.0 "-123.23E-02"+0.0
|
||||
12323 -1.2323 12323 -1.2323
|
||||
SELECT 2147483647E+02,21474836.47E+06;
|
||||
2147483647E+02 21474836.47E+06
|
||||
214748364700 21474836470000
|
||||
create table t1 (f1 float(24),f2 float(52));
|
||||
show full columns from t1;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
|
|
@ -209,3 +215,23 @@ c
|
|||
0.0002
|
||||
2e-05
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
reckey int unsigned NOT NULL,
|
||||
recdesc varchar(50) NOT NULL,
|
||||
PRIMARY KEY (reckey)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
INSERT INTO t1 VALUES (108, 'Has 108 as key');
|
||||
INSERT INTO t1 VALUES (109, 'Has 109 as key');
|
||||
select * from t1 where reckey=108;
|
||||
reckey recdesc
|
||||
108 Has 108 as key
|
||||
select * from t1 where reckey=1.08E2;
|
||||
reckey recdesc
|
||||
108 Has 108 as key
|
||||
select * from t1 where reckey=109;
|
||||
reckey recdesc
|
||||
109 Has 109 as key
|
||||
select * from t1 where reckey=1.09E2;
|
||||
reckey recdesc
|
||||
109 Has 109 as key
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ drop table t1;
|
|||
set @a=_latin2'test';
|
||||
select charset(@a),collation(@a),coercibility(@a);
|
||||
charset(@a) collation(@a) coercibility(@a)
|
||||
latin2 latin2_general_ci 3
|
||||
latin2 latin2_general_ci 2
|
||||
select @a=_latin2'TEST';
|
||||
@a=_latin2'TEST'
|
||||
1
|
||||
|
|
@ -137,12 +137,13 @@ select @a=_latin2'TEST' collate latin2_bin;
|
|||
set @a=_latin2'test' collate latin2_general_ci;
|
||||
select charset(@a),collation(@a),coercibility(@a);
|
||||
charset(@a) collation(@a) coercibility(@a)
|
||||
latin2 latin2_general_ci 0
|
||||
latin2 latin2_general_ci 2
|
||||
select @a=_latin2'TEST';
|
||||
@a=_latin2'TEST'
|
||||
1
|
||||
select @a=_latin2'TEST' collate latin2_bin;
|
||||
ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '='
|
||||
@a=_latin2'TEST' collate latin2_bin
|
||||
0
|
||||
select charset(@a:=_latin2'test');
|
||||
charset(@a:=_latin2'test')
|
||||
latin2
|
||||
|
|
@ -151,21 +152,22 @@ collation(@a:=_latin2'test')
|
|||
latin2_general_ci
|
||||
select coercibility(@a:=_latin2'test');
|
||||
coercibility(@a:=_latin2'test')
|
||||
3
|
||||
2
|
||||
select collation(@a:=_latin2'test' collate latin2_bin);
|
||||
collation(@a:=_latin2'test' collate latin2_bin)
|
||||
latin2_bin
|
||||
select coercibility(@a:=_latin2'test' collate latin2_bin);
|
||||
coercibility(@a:=_latin2'test' collate latin2_bin)
|
||||
0
|
||||
2
|
||||
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
|
||||
(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'
|
||||
0
|
||||
select charset(@a),collation(@a),coercibility(@a);
|
||||
charset(@a) collation(@a) coercibility(@a)
|
||||
latin2 latin2_bin 0
|
||||
latin2 latin2_bin 2
|
||||
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
|
||||
ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '='
|
||||
(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci
|
||||
1
|
||||
create table t1 (a varchar(50));
|
||||
reset master;
|
||||
SET TIMESTAMP=10000;
|
||||
|
|
|
|||
|
|
@ -47,3 +47,11 @@ create table t1 (v varchar(128));
|
|||
insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd');
|
||||
select * from t1 procedure analyse();
|
||||
drop table t1;
|
||||
|
||||
#decimal-related test
|
||||
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
select * from t1 procedure analyse();
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -118,3 +118,11 @@ select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
|
|||
select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
|
||||
# Still we should not throw away "days" part of time value
|
||||
select timediff(cast('1 12:00:00' as time), '12:00:00');
|
||||
|
||||
#decimal-related additions
|
||||
select cast('1.2' as decimal(3,2));
|
||||
select 1e18 * cast('1.2' as decimal(3,2));
|
||||
select cast(cast('1.2' as decimal(3,2)) as signed);
|
||||
set @v1=1e18;
|
||||
select cast(@v1 as decimal(22, 2));
|
||||
select cast(-1e18 as decimal(22,2));
|
||||
|
|
|
|||
|
|
@ -66,3 +66,12 @@ SET collation_connection='latin1_swedish_ci';
|
|||
-- source include/ctype_filesort.inc
|
||||
SET collation_connection='latin1_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
|
||||
#
|
||||
# Bug#8041
|
||||
# An unknown character (e.g. 0x84) should result in ERROR,
|
||||
# It was treated like a space character earlier.
|
||||
# Howerver, it should still work fine as a string part.
|
||||
--error 1064
|
||||
CREATE TABLE „a (a int);
|
||||
SELECT '„a' as str;
|
||||
|
|
|
|||
|
|
@ -693,3 +693,8 @@ INSERT INTO t1 VALUES ('one'),('two');
|
|||
SELECT CHARSET('a');
|
||||
SELECT user, CONCAT('<', user, '>') AS c FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#8385: utf8_general_ci treats Cyrillic letters I and SHORT I as the same
|
||||
#
|
||||
select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8);
|
||||
|
|
|
|||
|
|
@ -236,3 +236,15 @@ INSERT INTO t1 VALUES ('root','localhost'), ('root','%');
|
|||
--error 1242
|
||||
SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# test of union subquery in the FROM clause with complex distinct/all (BUG#6565)
|
||||
#
|
||||
create table t1(a int);
|
||||
create table t2(a int);
|
||||
create table t3(a int);
|
||||
insert into t1 values(1),(1);
|
||||
insert into t2 values(2),(2);
|
||||
insert into t3 values(3),(3);
|
||||
select * from t1 union distinct select * from t2 union all select * from t3;
|
||||
select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
|
||||
drop table t1, t2, t3;
|
||||
|
|
|
|||
|
|
@ -492,3 +492,25 @@ drop table t2;
|
|||
create table t2 select f2 from (select now() f2 from t1) a;
|
||||
show columns from t2;
|
||||
drop table t2, t1;
|
||||
|
||||
# decimal-related tests
|
||||
create table t2 (ff double);
|
||||
insert into t2 values (2.2);
|
||||
select cast(sum(distinct ff) as decimal(5,2)) from t2;
|
||||
select cast(sum(distinct ff) as signed) from t2;
|
||||
select cast(variance(ff) as decimal(10,3)) from t2;
|
||||
select cast(min(ff) as decimal(5,2)) from t2;
|
||||
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
select cast(sum(distinct df) as signed) from t1;
|
||||
select cast(min(df) as signed) from t1;
|
||||
select 1e8 * sum(distinct df) from t1;
|
||||
select 1e8 * min(df) from t1;
|
||||
|
||||
create table t3 (ifl int);
|
||||
insert into t3 values(1), (2);
|
||||
select cast(min(ifl) as decimal(5,2)) from t3;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;
|
|||
# Verify that CPK is always used for index intersection scans
|
||||
# (this is because it is used as a filter, not for retrieval)
|
||||
explain select * from t1 where badkey=1 and key1=10;
|
||||
--replace_result 38 ROWS 37 ROWS
|
||||
explain select * from t1 where pk1 < 7500 and key1 = 10;
|
||||
|
||||
# Verify that keys with 'tails' of PK members are ok.
|
||||
|
|
|
|||
|
|
@ -1278,3 +1278,7 @@ show variables like "innodb_thread_sleep_delay";
|
|||
# InnoDB specific varchar tests
|
||||
--error 1074
|
||||
create table t1 (v varchar(16384)) engine=innodb;
|
||||
|
||||
# The following should be moved to type_bit.test when innodb will support it
|
||||
--error 1178
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
|
|
|
|||
2
mysql-test/t/multi_statement-master.opt
Normal file
2
mysql-test/t/multi_statement-master.opt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
--log-slow-queries=slow.log
|
||||
--log-queries-not-using-indexes
|
||||
|
|
@ -14,3 +14,18 @@ select "abcd'";'abcd'select "'abcd";'abcd'
|
|||
select 5'abcd'
|
||||
delimiter ;'abcd'
|
||||
select 'finish';
|
||||
|
||||
# Bug #8475: Make sure every statement that is a slow query in
|
||||
# a multi-statement query gets logged as a slow query.
|
||||
flush status;
|
||||
delimiter ||||;
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
select * from t1 where i = 1;
|
||||
insert into t1 values (2),(3),(4);
|
||||
select * from t1 where i = 2;
|
||||
select * from t1 where i = 3||||
|
||||
show status like 'Slow_queries'||||
|
||||
drop table t1||||
|
||||
|
||||
delimiter ;||||
|
||||
|
|
|
|||
|
|
@ -539,3 +539,20 @@ eval set storage_engine=$default;
|
|||
# MyISAM specific varchar tests
|
||||
--error 1118
|
||||
create table t1 (v varchar(65535));
|
||||
|
||||
#
|
||||
# Test how DROP TABLE works if the index or data file doesn't exists
|
||||
|
||||
create table t1 (a int) engine=myisam;
|
||||
system rm ./var/master-data/test/t1.MYI ;
|
||||
drop table if exists t1;
|
||||
create table t1 (a int) engine=myisam;
|
||||
system rm ./var/master-data/test/t1.MYI ;
|
||||
--error 1051,6
|
||||
drop table t1;
|
||||
create table t1 (a int) engine=myisam;
|
||||
system rm ./var/master-data/test/t1.MYD ;
|
||||
--error 1105,6
|
||||
drop table t1;
|
||||
--error 1051
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
# We run with different binaries for normal and --embedded-server
|
||||
#
|
||||
# If this test fails with "command "$MYSQL_CLIENT_TEST" failed",
|
||||
# you should either run mysql_client_test separartely against a running
|
||||
# server or run mysql-test-run --debug mysql_client_test and check
|
||||
# var/log/mysql_client_test.trace
|
||||
|
||||
--disable_result_log
|
||||
--exec echo $MYSQL_CLIENT_TEST
|
||||
--exec $MYSQL_CLIENT_TEST
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
--disable_warnings
|
||||
drop table if exists t5, t6, t7, t8;
|
||||
drop database if exists mysqltest ;
|
||||
|
||||
# Cleanup from other tests
|
||||
drop database if exists client_test_db;
|
||||
drop database if exists testtets;
|
||||
drop table if exists t1Aa,t2Aa,v1Aa,v2Aa;
|
||||
drop view if exists t1Aa,t2Aa,v1Aa,v2Aa;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ source include/master-slave.inc;
|
|||
create table t1 (a int) engine=myisam;
|
||||
flush tables;
|
||||
system rm ./var/master-data/test/t1.MYI ;
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
|
|
|||
|
|
@ -157,3 +157,15 @@ connection master;
|
|||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# BUG#6676: Derivation of variables must be correct on slave
|
||||
#
|
||||
connection master;
|
||||
create table `t1` (
|
||||
`pk` varchar(10) not null default '',
|
||||
primary key (`pk`)
|
||||
) engine=myisam default charset=latin1;
|
||||
set @p=_latin1 'test';
|
||||
update t1 set pk='test' where pk=@p;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
|
|
|||
|
|
@ -152,3 +152,31 @@ unlock tables;
|
|||
connection master;
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# now the same in a transaction
|
||||
#
|
||||
slave stop; # we don't need it anymore
|
||||
connection master;
|
||||
reset master;
|
||||
let $1=100;
|
||||
|
||||
--disable_warnings
|
||||
create table t1 (n int) engine=innodb;
|
||||
--enable_warnings
|
||||
begin;
|
||||
--disable_query_log
|
||||
while ($1)
|
||||
{
|
||||
eval insert into t1 values($1 + 4);
|
||||
dec $1;
|
||||
}
|
||||
--enable_query_log
|
||||
commit;
|
||||
drop table t1;
|
||||
let $VERSION=`select version()`;
|
||||
--replace_result $VERSION VERSION "xid=373" "xid=146"
|
||||
show binlog events in 'master-bin.000001';
|
||||
--replace_result $VERSION VERSION
|
||||
show binlog events in 'master-bin.000002';
|
||||
|
||||
|
|
|
|||
|
|
@ -828,8 +828,8 @@ DROP TABLE t1;
|
|||
# Test INSERT with DOUBLE
|
||||
|
||||
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
|
||||
INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
|
||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
|
||||
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
|
||||
INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308');
|
||||
# We don't give warnings for underflow
|
||||
INSERT INTO t1 (col1) VALUES (-2.2E-330);
|
||||
--error 1367,1264
|
||||
|
|
|
|||
|
|
@ -1543,3 +1543,26 @@ group by
|
|||
|
||||
drop table if exists t1, t2, t3, t4, t5;
|
||||
|
||||
|
||||
#decimal-related tests
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
insert into t1 values(2.2);
|
||||
|
||||
select * from t1 where df <= all (select avg(df) from t1 group by df);
|
||||
select * from t1 where df >= all (select avg(df) from t1 group by df);
|
||||
drop table t1;
|
||||
|
||||
create table t1 (df decimal(5,1));
|
||||
insert into t1 values(1.1);
|
||||
select 1.1 * exists(select * from t1);
|
||||
drop table t1;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
grp int(11) default NULL,
|
||||
a decimal(10,2) default NULL);
|
||||
|
||||
insert into t1 values (1, 1), (2, 2), (2, 3), (3, 4), (3, 5), (3, 6), (NULL, NULL);
|
||||
select * from t1;
|
||||
select min(a) from t1 group by grp;
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -26,9 +26,6 @@ create table t1 (a bit(0));
|
|||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--error 1178
|
||||
create table t1 (a bit, key(a)) engine=innodb;
|
||||
|
||||
create table t1 (a bit(64));
|
||||
insert into t1 values
|
||||
(b'1111111111111111111111111111111111111111111111111111111111111111'),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# bug in decimal() with negative numbers by kaido@tradenet.ee
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
SET SQL_WARNINGS=1;
|
||||
|
||||
|
|
@ -268,3 +268,20 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000
|
|||
--enable_warnings
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# Test for BUG#8397: decimal type in subselects (Item_cache_decimal)
|
||||
CREATE TABLE t1
|
||||
(EMPNUM CHAR(3) NOT NULL,
|
||||
HOURS DECIMAL(5));
|
||||
CREATE TABLE t2
|
||||
(EMPNUM CHAR(3) NOT NULL,
|
||||
HOURS BIGINT);
|
||||
|
||||
INSERT INTO t1 VALUES ('E1',40);
|
||||
INSERT INTO t1 VALUES ('E8',NULL);
|
||||
INSERT INTO t2 VALUES ('E1',40);
|
||||
|
||||
SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t2);
|
||||
SELECT EMPNUM FROM t1 WHERE HOURS IN (SELECT HOURS FROM t1);
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ SELECT 10,10.0,10.,.1e+2,100.0e-1;
|
|||
SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
|
||||
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
|
||||
SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01;
|
||||
SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0;
|
||||
SELECT 2147483647E+02,21474836.47E+06;
|
||||
|
||||
create table t1 (f1 float(24),f2 float(52));
|
||||
show full columns from t1;
|
||||
|
|
@ -122,3 +124,23 @@ create table t1 (c char(6));
|
|||
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test of comparison of integer with float-in-range (Bug #7840)
|
||||
# This is needed because some ODBC applications (like Foxpro) uses
|
||||
# floats for everything.
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
reckey int unsigned NOT NULL,
|
||||
recdesc varchar(50) NOT NULL,
|
||||
PRIMARY KEY (reckey)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
INSERT INTO t1 VALUES (108, 'Has 108 as key');
|
||||
INSERT INTO t1 VALUES (109, 'Has 109 as key');
|
||||
select * from t1 where reckey=108;
|
||||
select * from t1 where reckey=1.08E2;
|
||||
select * from t1 where reckey=109;
|
||||
select * from t1 where reckey=1.09E2;
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ select @a=_latin2'TEST' collate latin2_bin;
|
|||
set @a=_latin2'test' collate latin2_general_ci;
|
||||
select charset(@a),collation(@a),coercibility(@a);
|
||||
select @a=_latin2'TEST';
|
||||
--error 1267
|
||||
select @a=_latin2'TEST' collate latin2_bin;
|
||||
|
||||
#
|
||||
|
|
@ -98,7 +97,6 @@ select collation(@a:=_latin2'test' collate latin2_bin);
|
|||
select coercibility(@a:=_latin2'test' collate latin2_bin);
|
||||
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
|
||||
select charset(@a),collation(@a),coercibility(@a);
|
||||
--error 1267
|
||||
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
|
||||
|
||||
# Check that user variables are binlogged correctly (BUG#3875)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs)
|
|||
else if (my_mbcharlen(cs, i)>1)
|
||||
state_map[i]=(uchar) MY_LEX_IDENT;
|
||||
#endif
|
||||
else if (!my_isgraph(cs,i))
|
||||
else if (my_isspace(cs,i))
|
||||
state_map[i]=(uchar) MY_LEX_SKIP;
|
||||
else
|
||||
state_map[i]=(uchar) MY_LEX_CHAR;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ const char *opt_ndb_connectstring= 0;
|
|||
const char *opt_connect_str= 0;
|
||||
const char *opt_ndb_mgmd= 0;
|
||||
char opt_ndb_constrbuf[1024];
|
||||
unsigned opt_ndb_constrbuf_len;
|
||||
unsigned opt_ndb_constrbuf_len= 0;
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
const char *opt_debug= 0;
|
||||
#endif
|
||||
|
||||
#define OPT_NDB_CONNECTSTRING 'c'
|
||||
|
||||
|
|
@ -75,7 +79,8 @@ unsigned opt_ndb_constrbuf_len;
|
|||
#ifndef DBUG_OFF
|
||||
#define NDB_STD_OPTS(prog_name) \
|
||||
{ "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
|
||||
(gptr*) &opt_debug, (gptr*) &opt_debug, \
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
|
||||
NDB_STD_OPTS_COMMON
|
||||
#else
|
||||
#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
|
||||
|
|
@ -101,15 +106,21 @@ enum ndb_std_options {
|
|||
static my_bool
|
||||
ndb_std_get_one_option(int optid,
|
||||
const struct my_option *opt __attribute__((unused)),
|
||||
const char *argument)
|
||||
char *argument)
|
||||
{
|
||||
switch (optid) {
|
||||
#ifndef DBUG_OFF
|
||||
case '#':
|
||||
if (argument)
|
||||
if (opt_debug)
|
||||
{
|
||||
DBUG_PUSH(argument);
|
||||
DBUG_PUSH(opt_debug);
|
||||
}
|
||||
else
|
||||
{
|
||||
DBUG_PUSH("d:t");
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 'V':
|
||||
ndb_std_print_version();
|
||||
exit(0);
|
||||
|
|
|
|||
|
|
@ -76,15 +76,15 @@ LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level,
|
|||
const char* pMsg)
|
||||
{
|
||||
writeHeader(pCategory, level);
|
||||
if (m_count_repeated_messages == 0)
|
||||
if (m_count_repeated_messages <= 1)
|
||||
writeMessage(pMsg);
|
||||
else
|
||||
{
|
||||
BaseString str(pMsg);
|
||||
str.appfmt(" - Repeated %d times", m_count_repeated_messages);
|
||||
writeMessage(str.c_str());
|
||||
m_count_repeated_messages= 0;
|
||||
}
|
||||
m_count_repeated_messages= 0;
|
||||
writeFooter();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2245,10 +2245,10 @@ void Dbdict::checkSchemaStatus(Signal* signal)
|
|||
restartCreateTab(signal, tableId, oldEntry, false);
|
||||
return;
|
||||
}//if
|
||||
}
|
||||
ndbrequire(ok);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case SchemaFile::DROP_TABLE_STARTED:
|
||||
jam();
|
||||
case SchemaFile::DROP_TABLE_COMMITTED:{
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ SumaParticipant::execCONTINUEB(Signal* signal)
|
|||
void Suma::execAPI_FAILREQ(Signal* signal)
|
||||
{
|
||||
jamEntry();
|
||||
DBUG_ENTER("Suma::execAPI_FAILREQ");
|
||||
Uint32 failedApiNode = signal->theData[0];
|
||||
//BlockReference retRef = signal->theData[1];
|
||||
|
||||
|
|
@ -348,11 +349,13 @@ void Suma::execAPI_FAILREQ(Signal* signal)
|
|||
jam();
|
||||
c_failedApiNodes.clear(failedApiNode);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}//execAPI_FAILREQ()
|
||||
|
||||
bool
|
||||
SumaParticipant::removeSubscribersOnNode(Signal *signal, Uint32 nodeId)
|
||||
{
|
||||
DBUG_ENTER("SumaParticipant::removeSubscribersOnNode");
|
||||
bool found = false;
|
||||
|
||||
SubscriberPtr i_subbPtr;
|
||||
|
|
@ -372,20 +375,15 @@ SumaParticipant::removeSubscribersOnNode(Signal *signal, Uint32 nodeId)
|
|||
jam();
|
||||
sendSubStopReq(signal);
|
||||
}
|
||||
return found;
|
||||
DBUG_RETURN(found);
|
||||
}
|
||||
|
||||
void
|
||||
SumaParticipant::sendSubStopReq(Signal *signal){
|
||||
DBUG_ENTER("SumaParticipant::sendSubStopReq");
|
||||
static bool remove_lock = false;
|
||||
jam();
|
||||
|
||||
if(remove_lock) {
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
remove_lock = true;
|
||||
|
||||
SubscriberPtr subbPtr;
|
||||
c_removeDataSubscribers.first(subbPtr);
|
||||
if (subbPtr.isNull()){
|
||||
|
|
@ -398,9 +396,15 @@ SumaParticipant::sendSubStopReq(Signal *signal){
|
|||
c_failedApiNodes.clear();
|
||||
|
||||
remove_lock = false;
|
||||
return;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
if(remove_lock) {
|
||||
jam();
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
remove_lock = true;
|
||||
|
||||
SubscriptionPtr subPtr;
|
||||
c_subscriptions.getPtr(subPtr, subbPtr.p->m_subPtrI);
|
||||
|
||||
|
|
@ -414,6 +418,7 @@ SumaParticipant::sendSubStopReq(Signal *signal){
|
|||
req->part = SubscriptionData::TableData;
|
||||
|
||||
sendSignal(SUMA_REF, GSN_SUB_STOP_REQ, signal, SubStopReq::SignalLength, JBB);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -452,6 +457,8 @@ SumaParticipant::execSUB_STOP_REF(Signal* signal){
|
|||
jamEntry();
|
||||
SubStopRef * const ref = (SubStopRef*)signal->getDataPtr();
|
||||
|
||||
DBUG_ENTER("SumaParticipant::execSUB_STOP_REF");
|
||||
|
||||
Uint32 subscriptionId = ref->subscriptionId;
|
||||
Uint32 subscriptionKey = ref->subscriptionKey;
|
||||
Uint32 part = ref->part;
|
||||
|
|
@ -471,11 +478,14 @@ SumaParticipant::execSUB_STOP_REF(Signal* signal){
|
|||
req->part = part;
|
||||
|
||||
sendSignal(SUMA_REF, GSN_SUB_STOP_REQ, signal, SubStopReq::SignalLength, JBB);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
Suma::execNODE_FAILREP(Signal* signal){
|
||||
jamEntry();
|
||||
DBUG_ENTER("Suma::execNODE_FAILREP");
|
||||
|
||||
NodeFailRep * const rep = (NodeFailRep*)signal->getDataPtr();
|
||||
|
||||
|
|
@ -541,6 +551,7 @@ Suma::execNODE_FAILREP(Signal* signal){
|
|||
c_aliveNodes.clear(nodePtr.p->nodeId); // this has to be done after the loop above
|
||||
}
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1451,7 +1462,7 @@ SumaParticipant::execDIGETPRIMCONF(Signal* signal){
|
|||
void
|
||||
SumaParticipant::execCREATE_TRIG_CONF(Signal* signal){
|
||||
jamEntry();
|
||||
|
||||
DBUG_ENTER("SumaParticipant::execCREATE_TRIG_CONF");
|
||||
CRASH_INSERTION(13009);
|
||||
|
||||
CreateTrigConf * const conf = (CreateTrigConf*)signal->getDataPtr();
|
||||
|
|
@ -1464,6 +1475,7 @@ SumaParticipant::execCREATE_TRIG_CONF(Signal* signal){
|
|||
* dodido
|
||||
* @todo: I (Johan) dont know what to do here. Jonas, what do you mean?
|
||||
*/
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1475,7 +1487,7 @@ SumaParticipant::execCREATE_TRIG_REF(Signal* signal){
|
|||
void
|
||||
SumaParticipant::execDROP_TRIG_CONF(Signal* signal){
|
||||
jamEntry();
|
||||
|
||||
DBUG_ENTER("SumaParticipant::execDROP_TRIG_CONF");
|
||||
CRASH_INSERTION(13010);
|
||||
|
||||
DropTrigConf * const conf = (DropTrigConf*)signal->getDataPtr();
|
||||
|
|
@ -1483,17 +1495,19 @@ SumaParticipant::execDROP_TRIG_CONF(Signal* signal){
|
|||
const Uint32 senderData = conf->getConnectionPtr();
|
||||
SyncRecord* tmp = c_syncPool.getPtr(senderData);
|
||||
tmp->runDROP_TRIG_CONF(signal);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
SumaParticipant::execDROP_TRIG_REF(Signal* signal){
|
||||
jamEntry();
|
||||
|
||||
DBUG_ENTER("SumaParticipant::execDROP_TRIG_CONF");
|
||||
DropTrigRef * const ref = (DropTrigRef*)signal->getDataPtr();
|
||||
|
||||
const Uint32 senderData = ref->getConnectionPtr();
|
||||
SyncRecord* tmp = c_syncPool.getPtr(senderData);
|
||||
tmp->runDROP_TRIG_CONF(signal);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
@ -2821,7 +2835,7 @@ SumaParticipant::decideWhoToSend(Uint32 nBucket, Uint32 gci){
|
|||
void
|
||||
SumaParticipant::execFIRE_TRIG_ORD(Signal* signal){
|
||||
jamEntry();
|
||||
|
||||
DBUG_ENTER("SumaParticipant::execFIRE_TRIG_ORD");
|
||||
CRASH_INSERTION(13016);
|
||||
FireTrigOrd* const trg = (FireTrigOrd*)signal->getDataPtr();
|
||||
const Uint32 trigId = trg->getTriggerId();
|
||||
|
|
@ -2982,6 +2996,8 @@ SumaParticipant::execFIRE_TRIG_ORD(Signal* signal){
|
|||
*/
|
||||
f_bufferLock = 0;
|
||||
b_bufferLock = 0;
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -183,11 +183,9 @@ int main(int argc, char** argv)
|
|||
assert("Illegal state globalData.theRestartFlag" == 0);
|
||||
}
|
||||
|
||||
SocketServer socket_server;
|
||||
|
||||
globalTransporterRegistry.startSending();
|
||||
globalTransporterRegistry.startReceiving();
|
||||
if (!globalTransporterRegistry.start_service(socket_server)){
|
||||
if (!globalTransporterRegistry.start_service(*globalEmulatorData.m_socket_server)){
|
||||
ndbout_c("globalTransporterRegistry.start_service() failed");
|
||||
exit(-1);
|
||||
}
|
||||
|
|
@ -199,7 +197,7 @@ int main(int argc, char** argv)
|
|||
|
||||
globalEmulatorData.theWatchDog->doStart();
|
||||
|
||||
socket_server.startServer();
|
||||
globalEmulatorData.m_socket_server->startServer();
|
||||
|
||||
// theConfig->closeConfiguration();
|
||||
|
||||
|
|
@ -207,11 +205,6 @@ int main(int argc, char** argv)
|
|||
|
||||
NdbShutdown(NST_Normal);
|
||||
|
||||
socket_server.stopServer();
|
||||
socket_server.stopSessions();
|
||||
|
||||
globalTransporterRegistry.stop_clients();
|
||||
|
||||
return NRT_Default;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,13 +88,6 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt,
|
||||
argument ? argument : "d:t:O,/tmp/ndbd.trace");
|
||||
}
|
||||
|
||||
bool
|
||||
Configuration::init(int argc, char** argv)
|
||||
|
|
@ -103,7 +96,11 @@ Configuration::init(int argc, char** argv)
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndbd.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (_no_daemon) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ EmulatorData::EmulatorData(){
|
|||
theThreadConfig = 0;
|
||||
theSimBlockList = 0;
|
||||
theShutdownMutex = 0;
|
||||
m_socket_server = 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -83,6 +84,7 @@ EmulatorData::create(){
|
|||
theWatchDog = new WatchDog();
|
||||
theThreadConfig = new ThreadConfig();
|
||||
theSimBlockList = new SimBlockList();
|
||||
m_socket_server = new SocketServer();
|
||||
|
||||
theShutdownMutex = NdbMutex_Create();
|
||||
|
||||
|
|
@ -99,7 +101,8 @@ EmulatorData::destroy(){
|
|||
delete theThreadConfig; theThreadConfig = 0;
|
||||
if(theSimBlockList)
|
||||
delete theSimBlockList; theSimBlockList = 0;
|
||||
|
||||
if(m_socket_server)
|
||||
delete m_socket_server; m_socket_server = 0;
|
||||
NdbMem_Destroy();
|
||||
}
|
||||
|
||||
|
|
@ -195,9 +198,22 @@ NdbShutdown(NdbShutdownType type,
|
|||
fclose(outputStream);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Stop all transporter connection attempts and accepts
|
||||
*/
|
||||
globalEmulatorData.m_socket_server->stopServer();
|
||||
globalEmulatorData.m_socket_server->stopSessions();
|
||||
globalTransporterRegistry.stop_clients();
|
||||
|
||||
/**
|
||||
* Stop transporter communication with other nodes
|
||||
*/
|
||||
globalTransporterRegistry.stopSending();
|
||||
globalTransporterRegistry.stopReceiving();
|
||||
|
||||
/**
|
||||
* Remove all transporters
|
||||
*/
|
||||
globalTransporterRegistry.removeAll();
|
||||
|
||||
#ifdef VM_TRACE
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ struct EmulatorData {
|
|||
class WatchDog * theWatchDog;
|
||||
class ThreadConfig * theThreadConfig;
|
||||
class SimBlockList * theSimBlockList;
|
||||
class SocketServer * m_socket_server;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
|
|||
|
|
@ -87,13 +87,6 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_mgm.trace");
|
||||
}
|
||||
|
||||
static int
|
||||
read_and_execute(int _try_reconnect)
|
||||
|
|
@ -136,7 +129,11 @@ int main(int argc, char** argv){
|
|||
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_mgm.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
char buf[MAXHOSTNAMELEN+10];
|
||||
|
|
|
|||
|
|
@ -175,14 +175,6 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_mgmd.trace");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* MAIN
|
||||
|
|
@ -206,7 +198,11 @@ int main(int argc, char** argv)
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_mgmd.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (glob.interactive ||
|
||||
|
|
|
|||
|
|
@ -5,40 +5,22 @@
|
|||
#include <NdbApi.hpp>
|
||||
#include <HugoTransactions.hpp>
|
||||
|
||||
static const char* opt_connect_str= 0;
|
||||
static const char* _dbname = "TEST_DB";
|
||||
static int g_loops = 7;
|
||||
|
||||
static void print_version()
|
||||
{
|
||||
printf("MySQL distrib %s, for %s (%s)\n",
|
||||
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
|
||||
}
|
||||
static void usage()
|
||||
{
|
||||
char desc[] =
|
||||
"tabname\n"\
|
||||
"This program list all properties of table(s) in NDB Cluster.\n"\
|
||||
" ex: desc T1 T2 T4\n";
|
||||
print_version();
|
||||
ndb_std_print_version();
|
||||
}
|
||||
#if 0
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
const char *argument)
|
||||
{
|
||||
switch (optid) {
|
||||
case '#':
|
||||
DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_desc.trace");
|
||||
break;
|
||||
case 'V':
|
||||
print_version();
|
||||
exit(0);
|
||||
case '?':
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
return 0;
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/testBitfield.trace");
|
||||
}
|
||||
#endif
|
||||
|
||||
static const NdbDictionary::Table* create_random_table(Ndb*);
|
||||
static int transactions(Ndb*, const NdbDictionary::Table* tab);
|
||||
|
|
|
|||
|
|
@ -553,3 +553,32 @@ max-time: 500
|
|||
cmd: flexHammer
|
||||
args: -r 5 -t 32
|
||||
|
||||
max-time: 300
|
||||
cmd: DbCreate
|
||||
args:
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 1
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 25
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 100
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 200
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 1 -proc 25
|
||||
type: bench
|
||||
|
||||
|
|
|
|||
|
|
@ -204,32 +204,3 @@ max-time: 2500
|
|||
cmd: test_event
|
||||
args: -n BasicEventOperation T1 T6
|
||||
|
||||
max-time: 300
|
||||
cmd: DbCreate
|
||||
args:
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 1
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 25
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 100
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 200
|
||||
type: bench
|
||||
|
||||
max-time: 180
|
||||
cmd: DbAsyncGenerator
|
||||
args: -time 60 -p 1 -proc 25
|
||||
type: bench
|
||||
|
||||
|
|
|
|||
10
ndb/test/run-test/example.conf
Normal file
10
ndb/test/run-test/example.conf
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
target=pc-linux-i686
|
||||
base_dir=/ndb
|
||||
src_clone_base=mysqldev@bk-internal.mysql.com:/home/bk/mysql
|
||||
run_dir=/space/autotest
|
||||
build_dir=/ndb
|
||||
hosts="ndb01 ndb02 ndb03 ndb04 ndb05 ndb06 ndb07 ndb08 ndb09 ndb10 ndb11 ndb12"
|
||||
result_host="ndb.mysql.com"
|
||||
result_path="public_html"
|
||||
configure='CC=gcc CXX=gcc CFLAGS="-Wall -pedantic -Wno-long-long" CXXFLAGS="-Wall -pedantic -Wno-long-long" ./configure --with-ndbcluster --with-ndb-test --with-ndbcc-flags="-g -DERROR_INSERT"'
|
||||
|
||||
228
ndb/test/run-test/ndb-autotest.sh
Executable file
228
ndb/test/run-test/ndb-autotest.sh
Executable file
|
|
@ -0,0 +1,228 @@
|
|||
#!/bin/sh
|
||||
|
||||
save_args=$*
|
||||
VERSION="ndb-autotest.sh version 1.0"
|
||||
|
||||
DATE=`date '+%Y-%m-%d'`
|
||||
export DATE
|
||||
|
||||
set -e
|
||||
ulimit -Sc unlimited
|
||||
|
||||
echo "`date` starting: $*"
|
||||
|
||||
RSYNC_RSH=ssh
|
||||
export RSYNC_RSH
|
||||
|
||||
do_clone=yes
|
||||
build=yes
|
||||
deploy=yes
|
||||
|
||||
clone=5.0-ndb
|
||||
RUN="daily-basic daily-devel"
|
||||
conf=autotest.conf
|
||||
|
||||
while [ "$1" ]
|
||||
do
|
||||
case "$1" in
|
||||
--no-clone) do_clone="";;
|
||||
--no-build) build="";;
|
||||
--no-deploy) deploy="";;
|
||||
--clone=*) clone=`echo $1 | sed s/--clone=//`;;
|
||||
--conf=*) conf=`echo $1 | sed s/--conf=//`;;
|
||||
--version) echo $VERSION; exit;;
|
||||
*) RUN=$*;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -f $conf ]
|
||||
then
|
||||
. $conf
|
||||
else
|
||||
echo "Can't find config file: $conf"
|
||||
exit
|
||||
fi
|
||||
|
||||
env
|
||||
|
||||
LOCK=$HOME/.autotest-lock
|
||||
src_clone=$src_clone_base-$clone
|
||||
|
||||
if [ -f $LOCK ]
|
||||
then
|
||||
echo "Lock file exists: $LOCK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$DATE $RUN" > $LOCK
|
||||
trap "rm -f $LOCK" ERR
|
||||
|
||||
dst_place=${build_dir}/clone-mysql-$clone-$DATE
|
||||
|
||||
if [ "$do_clone" ]
|
||||
then
|
||||
rm -rf $dst_place
|
||||
bk clone $src_clone $dst_place
|
||||
fi
|
||||
|
||||
if [ "$build" ]
|
||||
then
|
||||
cd $dst_place
|
||||
rm -rf $run_dir/*
|
||||
aclocal; autoheader; autoconf; automake
|
||||
(cd innobase; aclocal; autoheader; autoconf; automake)
|
||||
(cd bdb/dist; sh s_all)
|
||||
eval $configure --prefix=$run_dir
|
||||
make
|
||||
make install
|
||||
fi
|
||||
|
||||
###
|
||||
# check script version
|
||||
#
|
||||
script=$run_dir/mysql-test/ndb/ndb-autotest.sh
|
||||
if [ -x $script ]
|
||||
then
|
||||
$script --version > /tmp/version.$$
|
||||
else
|
||||
echo $VERSION > /tmp/version.$$
|
||||
fi
|
||||
match=`grep -c "$VERSION" /tmp/version.$$`
|
||||
rm -f /tmp/version.$$
|
||||
if [ $match -eq 0 ]
|
||||
then
|
||||
echo "Incorrect script version...restarting"
|
||||
cp $run_dir/mysql-test/ndb/ndb-autotest.sh /tmp/at.$$.sh
|
||||
rm -rf $run_dir $dst_place
|
||||
sh /tmp/at.$$.sh $save_args
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that all interesting files are present
|
||||
test_dir=$run_dir/mysql-test/ndb
|
||||
atrt=$test_dir/atrt
|
||||
html=$test_dir/make-html-reports.sh
|
||||
PATH=$test_dir:$PATH
|
||||
export PATH
|
||||
|
||||
filter(){
|
||||
neg=$1
|
||||
shift
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
if [ `grep -c $1 $neg` -eq 0 ] ; then echo $1; fi
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
###
|
||||
# check ndb_cpcc fail hosts
|
||||
#
|
||||
ndb_cpcc $hosts | awk '{ if($1=="Failed"){ print;}}' > /tmp/failed.$DATE
|
||||
filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
|
||||
hosts=`cat /tmp/hosts.$DATE`
|
||||
|
||||
if [ "$deploy" ]
|
||||
then
|
||||
(cd / && tar cfz /tmp/build.$DATE.tgz $run_dir )
|
||||
for i in $hosts
|
||||
do
|
||||
ok=0
|
||||
scp /tmp/build.$DATE.tgz $i:/tmp/build.$DATE.$$.tgz && \
|
||||
ssh $i "rm -rf /space/autotest/*" && \
|
||||
ssh $i "cd / && tar xfz /tmp/build.$DATE.$$.tgz" && \
|
||||
ssh $i "rm /tmp/build.$DATE.$$.tgz" && ok=1
|
||||
if [ $ok -eq 0 ]
|
||||
then
|
||||
echo "$i failed during scp/ssh, excluding"
|
||||
echo $i >> /tmp/failed.$DATE
|
||||
fi
|
||||
done
|
||||
fi
|
||||
rm -f /tmp/build.$DATE.tgz
|
||||
|
||||
###
|
||||
# handle scp failed hosts
|
||||
#
|
||||
filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
|
||||
hosts=`cat /tmp/hosts.$DATE`
|
||||
cat /tmp/failed.$DATE > /tmp/filter_hosts.$$
|
||||
|
||||
###
|
||||
# functions for running atrt
|
||||
#
|
||||
choose(){
|
||||
SRC=$1
|
||||
TMP1=/tmp/choose.$$
|
||||
TMP2=/tmp/choose.$$.$$
|
||||
shift
|
||||
|
||||
cp $SRC $TMP1
|
||||
i=1
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
sed -e s,"CHOOSE_host$i",$1,g < $TMP1 > $TMP2
|
||||
mv $TMP2 $TMP1
|
||||
shift
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
cat $TMP1
|
||||
rm -f $TMP1
|
||||
}
|
||||
start(){
|
||||
rm -rf report.txt result* log.txt
|
||||
$atrt -v -v -r -R --log-file=log.txt --testcase-file=$test_dir/$2-tests.txt &
|
||||
pid=$!
|
||||
echo $pid > run.pid
|
||||
wait $pid
|
||||
rm run.pid
|
||||
[ -f log.txt ] && mv log.txt $3
|
||||
[ -f report.txt ] && mv report.txt $3
|
||||
[ "`find . -name 'result*'`" ] && mv result* $3
|
||||
cd $3
|
||||
sh $html . $1 $DATE
|
||||
cd ..
|
||||
p2=`pwd`
|
||||
cd ..
|
||||
tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE
|
||||
scp /tmp/res.$$.tgz $result_host:$result_path
|
||||
ssh $result_host "cd $result_path && tar xfz res.$$.tgz && rm -f res.$$.tgz"
|
||||
rm -f /tmp/res.$$.tgz
|
||||
}
|
||||
|
||||
p=`pwd`
|
||||
for dir in $RUN
|
||||
do
|
||||
echo "Fixing hosts for $dir"
|
||||
|
||||
run_dir=$base_dir/run-$dir-mysql-$clone-$target
|
||||
res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE
|
||||
|
||||
mkdir -p $res_dir
|
||||
rm -rf $res_dir/*
|
||||
|
||||
count=`grep -c "COMPUTER" $run_dir/1.ndb_mgmd/initconfig.template`
|
||||
avail_hosts=`filter /tmp/filter_hosts.$$ $hosts`
|
||||
avail=`echo $avail_hosts | wc -w`
|
||||
if [ $count -gt $avail ]
|
||||
then
|
||||
echo "Not enough hosts"
|
||||
echo "Needs: $count available: $avail ($avail_hosts)"
|
||||
break;
|
||||
fi
|
||||
|
||||
run_hosts=`echo $avail_hosts| awk '{for(i=1;i<='$count';i++)print $i;}'`
|
||||
choose $run_dir/d.template $run_hosts > $run_dir/d.txt
|
||||
choose $run_dir/1.ndb_mgmd/initconfig.template $run_hosts > $run_dir/1.ndb_mgmd/config.ini
|
||||
echo $run_hosts >> /tmp/filter_hosts.$$
|
||||
|
||||
cd $run_dir
|
||||
start $dir-mysql-$clone-$target $dir $res_dir &
|
||||
done
|
||||
cd $p
|
||||
rm /tmp/filter_hosts.$$
|
||||
|
||||
wait
|
||||
|
||||
rm -f $LOCK
|
||||
|
|
@ -44,20 +44,17 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_delete_all.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_delete_all.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
|
||||
Ndb_cluster_connection con(opt_connect_str);
|
||||
|
|
|
|||
|
|
@ -44,20 +44,17 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_desc.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_desc.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
|
||||
Ndb_cluster_connection con(opt_connect_str);
|
||||
|
|
|
|||
|
|
@ -41,20 +41,17 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_drop_index.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
"d:t:O,/tmp/ndb_drop_index.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
|
|
|
|||
|
|
@ -41,20 +41,17 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_drop_table.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
"d:t:O,/tmp/ndb_drop_table.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
|
|
|
|||
|
|
@ -196,13 +196,6 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_show_tables.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
|
|
@ -210,7 +203,11 @@ int main(int argc, char** argv){
|
|||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_show_tables.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
_tabname = argv[0];
|
||||
|
||||
|
|
|
|||
|
|
@ -109,8 +109,10 @@ static my_bool
|
|||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_restore.trace");
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_restore.trace";
|
||||
#endif
|
||||
ndb_std_get_one_option(optid, opt, argument);
|
||||
switch (optid) {
|
||||
case 'n':
|
||||
if (ga_nodeId == 0)
|
||||
|
|
|
|||
|
|
@ -85,13 +85,6 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_select_all.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
|
|
@ -99,7 +92,11 @@ int main(int argc, char** argv){
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
const char* _tabname;
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_select_all.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
if ((_tabname = argv[0]) == 0) {
|
||||
usage();
|
||||
|
|
|
|||
|
|
@ -60,20 +60,17 @@ static void usage()
|
|||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
}
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_select_count.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_select_count.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
|
|
|
|||
|
|
@ -60,24 +60,19 @@ static void usage()
|
|||
my_print_variables(my_long_options);
|
||||
}
|
||||
|
||||
static my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
return ndb_std_get_one_option(optid, opt, argument ? argument :
|
||||
"d:t:O,/tmp/ndb_drop_table.trace");
|
||||
}
|
||||
|
||||
int main(int argc, char** argv){
|
||||
NDB_INIT(argv[0]);
|
||||
const char *load_default_groups[]= { "mysql_cluster",0 };
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
const char* _hostName = NULL;
|
||||
int ho_error;
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
#ifndef DBUG_OFF
|
||||
opt_debug= "d:t:O,/tmp/ndb_waiter.trace";
|
||||
#endif
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options,
|
||||
ndb_std_get_one_option)))
|
||||
return NDBT_ProgramExit(NDBT_WRONGARGS);
|
||||
|
||||
char buf[255];
|
||||
_hostName = argv[0];
|
||||
|
||||
if (_hostName == 0)
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ if [ x$NDBCLUSTER = x1 ]; then
|
|||
$CP $BASE/ndb-stage@bindir@/* $BASE/bin/.
|
||||
$CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/.
|
||||
$CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/.
|
||||
$CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/lib/.
|
||||
$CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include
|
||||
$CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1
|
||||
rm -rf $BASE/ndb-stage
|
||||
fi
|
||||
|
|
|
|||
11
sql/field.cc
11
sql/field.cc
|
|
@ -2432,12 +2432,23 @@ void Field_medium::sql_type(String &res) const
|
|||
** long int
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
A helper function to check whether the next character
|
||||
in the string "s" is MINUS SIGN.
|
||||
*/
|
||||
#ifdef HAVE_CHARSET_ucs2
|
||||
static bool test_if_minus(CHARSET_INFO *cs,
|
||||
const char *s, const char *e)
|
||||
{
|
||||
my_wc_t wc;
|
||||
return cs->cset->mb_wc(cs, &wc, (uchar*) s, (uchar*) e) > 0 && wc == '-';
|
||||
}
|
||||
#else
|
||||
/*
|
||||
If not UCS2 support is compiled then it is easier
|
||||
*/
|
||||
#define test_if_minus(cs, s, e) (*s == '-')
|
||||
#endif
|
||||
|
||||
|
||||
int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||
|
|
|
|||
|
|
@ -336,6 +336,11 @@ innobase_release_temporary_latches(
|
|||
/*===============================*/
|
||||
THD *thd)
|
||||
{
|
||||
if (!innodb_inited) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
trx_t *trx= (trx_t*) thd->ha_data[innobase_hton.slot];
|
||||
if (trx)
|
||||
innobase_release_stat_resources(trx);
|
||||
|
|
@ -1341,7 +1346,7 @@ innobase_commit_low(
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
#ifdef DISABLE_HAVE_REPLICATION
|
||||
if (current_thd->slave_thread) {
|
||||
/* Update the replication position info inside InnoDB */
|
||||
|
||||
|
|
@ -1693,7 +1698,9 @@ innobase_rollback_to_savepoint(
|
|||
innobase_release_stat_resources(trx);
|
||||
|
||||
/* TODO: use provided savepoint data area to store savepoint data */
|
||||
char name[16]; sprintf(name, "s_%08lx", savepoint);
|
||||
char name[64];
|
||||
longlong2str((ulonglong)savepoint,name,36);
|
||||
|
||||
error = trx_rollback_to_savepoint_for_mysql(trx, name,
|
||||
&mysql_binlog_cache_pos);
|
||||
DBUG_RETURN(convert_error_code_to_mysql(error, NULL));
|
||||
|
|
@ -1719,7 +1726,9 @@ innobase_release_savepoint(
|
|||
trx = check_trx_exists(thd);
|
||||
|
||||
/* TODO: use provided savepoint data area to store savepoint data */
|
||||
char name[16]; sprintf(name, "s_%08lx", savepoint);
|
||||
char name[64];
|
||||
longlong2str((ulonglong)savepoint,name,36);
|
||||
|
||||
error = trx_release_savepoint_for_mysql(trx, name);
|
||||
|
||||
DBUG_RETURN(convert_error_code_to_mysql(error, NULL));
|
||||
|
|
@ -1758,7 +1767,9 @@ innobase_savepoint(
|
|||
DBUG_ASSERT(trx->active_trans);
|
||||
|
||||
/* TODO: use provided savepoint data area to store savepoint data */
|
||||
char name[16]; sprintf(name, "s_%08lx", savepoint);
|
||||
char name[64];
|
||||
longlong2str((ulonglong)savepoint,name,36);
|
||||
|
||||
error = trx_savepoint_for_mysql(trx, name, (ib_longlong)0);
|
||||
|
||||
DBUG_RETURN(convert_error_code_to_mysql(error, NULL));
|
||||
|
|
|
|||
|
|
@ -4528,7 +4528,11 @@ ndbcluster_init()
|
|||
(opt_ndb_optimized_node_selection);
|
||||
|
||||
// Create a Ndb object to open the connection to NDB
|
||||
g_ndb= new Ndb(g_ndb_cluster_connection, "sys");
|
||||
if ( (g_ndb= new Ndb(g_ndb_cluster_connection, "sys")) == 0 )
|
||||
{
|
||||
DBUG_PRINT("error", ("failed to create global ndb object"));
|
||||
goto ndbcluster_init_error;
|
||||
}
|
||||
g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_table_local_info));
|
||||
if (g_ndb->init() != 0)
|
||||
{
|
||||
|
|
@ -4581,6 +4585,10 @@ ndbcluster_init()
|
|||
if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0))
|
||||
{
|
||||
DBUG_PRINT("error", ("Could not create ndb utility thread"));
|
||||
hash_free(&ndbcluster_open_tables);
|
||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
pthread_cond_destroy(&COND_ndb_util_thread);
|
||||
goto ndbcluster_init_error;
|
||||
}
|
||||
|
||||
|
|
@ -4588,7 +4596,12 @@ ndbcluster_init()
|
|||
DBUG_RETURN(&ndbcluster_hton);
|
||||
|
||||
ndbcluster_init_error:
|
||||
ndbcluster_end();
|
||||
if(g_ndb)
|
||||
delete g_ndb;
|
||||
g_ndb= NULL;
|
||||
if (g_ndb_cluster_connection)
|
||||
delete g_ndb_cluster_connection;
|
||||
g_ndb_cluster_connection= NULL;
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
|
||||
|
|
@ -4603,6 +4616,9 @@ bool ndbcluster_end()
|
|||
{
|
||||
DBUG_ENTER("ndbcluster_end");
|
||||
|
||||
if (!ndbcluster_inited)
|
||||
DBUG_RETURN(0);
|
||||
|
||||
// Kill ndb utility thread
|
||||
(void) pthread_mutex_lock(&LOCK_ndb_util_thread);
|
||||
DBUG_PRINT("exit",("killing ndb util thread: %lx", ndb_util_thread));
|
||||
|
|
@ -4615,8 +4631,7 @@ bool ndbcluster_end()
|
|||
if (g_ndb_cluster_connection)
|
||||
delete g_ndb_cluster_connection;
|
||||
g_ndb_cluster_connection= NULL;
|
||||
if (!ndbcluster_inited)
|
||||
DBUG_RETURN(0);
|
||||
|
||||
hash_free(&ndbcluster_open_tables);
|
||||
pthread_mutex_destroy(&ndbcluster_mutex);
|
||||
pthread_mutex_destroy(&LOCK_ndb_util_thread);
|
||||
|
|
|
|||
|
|
@ -553,6 +553,7 @@ int ha_commit_trans(THD *thd, bool all)
|
|||
#ifdef USING_TRANSACTIONS
|
||||
if (trans->nht)
|
||||
{
|
||||
DBUG_EXECUTE_IF("crash_commit_before", abort(););
|
||||
if (!trans->no_2pc && trans->nht > 1)
|
||||
{
|
||||
for (; *ht && !error; ht++)
|
||||
|
|
@ -565,16 +566,20 @@ int ha_commit_trans(THD *thd, bool all)
|
|||
}
|
||||
statistic_increment(thd->status_var.ha_prepare_count,&LOCK_status);
|
||||
}
|
||||
DBUG_EXECUTE_IF("crash_commit_after_prepare", abort(););
|
||||
if (error || (is_real_trans && xid &&
|
||||
(error= !(cookie= tc_log->log(thd, xid)))))
|
||||
{
|
||||
ha_rollback_trans(thd, all);
|
||||
return 1;
|
||||
}
|
||||
DBUG_EXECUTE_IF("crash_commit_after_log", abort(););
|
||||
}
|
||||
error=ha_commit_one_phase(thd, all) ? cookie ? 2 : 1 : 0;
|
||||
DBUG_EXECUTE_IF("crash_commit_before_unlog", abort(););
|
||||
if (cookie)
|
||||
tc_log->unlog(cookie, xid);
|
||||
DBUG_EXECUTE_IF("crash_commit_after", abort(););
|
||||
}
|
||||
#endif /* USING_TRANSACTIONS */
|
||||
DBUG_RETURN(error);
|
||||
|
|
@ -738,8 +743,7 @@ int ha_recover(HASH *commit_list)
|
|||
DBUG_ASSERT(total_ha_2pc);
|
||||
DBUG_ASSERT(commit_list || tc_heuristic_recover);
|
||||
|
||||
for (len=commit_list ? commit_list->records : MAX_XID_LIST_SIZE ;
|
||||
list==0 && len > MIN_XID_LIST_SIZE; len/=2)
|
||||
for (len= MAX_XID_LIST_SIZE ; list==0 && len > MIN_XID_LIST_SIZE; len/=2)
|
||||
{
|
||||
list=(XID *)my_malloc(len*sizeof(XID), MYF(0));
|
||||
}
|
||||
|
|
@ -1027,15 +1031,24 @@ bool ha_flush_logs()
|
|||
The .frm file will be deleted only if we return 0 or ENOENT
|
||||
*/
|
||||
|
||||
int ha_delete_table(enum db_type table_type, const char *path)
|
||||
int ha_delete_table(THD *thd, enum db_type table_type, const char *path,
|
||||
const char *alias, bool generate_warning)
|
||||
{
|
||||
handler *file;
|
||||
char tmp_path[FN_REFLEN];
|
||||
int error;
|
||||
TABLE dummy_table;
|
||||
TABLE_SHARE dummy_share;
|
||||
DBUG_ENTER("ha_delete_table");
|
||||
|
||||
bzero((char*) &dummy_table, sizeof(dummy_table));
|
||||
bzero((char*) &dummy_share, sizeof(dummy_share));
|
||||
dummy_table.s= &dummy_share;
|
||||
|
||||
/* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */
|
||||
if (table_type == DB_TYPE_UNKNOWN ||
|
||||
! (file=get_new_handler((TABLE*) 0, table_type)))
|
||||
return ENOENT;
|
||||
! (file=get_new_handler(&dummy_table, table_type)))
|
||||
DBUG_RETURN(ENOENT);
|
||||
|
||||
if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED))
|
||||
{
|
||||
|
|
@ -1044,9 +1057,45 @@ int ha_delete_table(enum db_type table_type, const char *path)
|
|||
my_casedn_str(files_charset_info, tmp_path);
|
||||
path= tmp_path;
|
||||
}
|
||||
int error=file->delete_table(path);
|
||||
if ((error= file->delete_table(path)) && generate_warning)
|
||||
{
|
||||
/*
|
||||
Because file->print_error() use my_error() to generate the error message
|
||||
we must store the error state in thd, reset it and restore it to
|
||||
be able to get hold of the error message.
|
||||
(We should in the future either rewrite handler::print_error() or make
|
||||
a nice method of this.
|
||||
*/
|
||||
bool query_error= thd->query_error;
|
||||
sp_rcontext *spcont= thd->spcont;
|
||||
SELECT_LEX *current_select= thd->lex->current_select;
|
||||
char buff[sizeof(thd->net.last_error)];
|
||||
char new_error[sizeof(thd->net.last_error)];
|
||||
int last_errno= thd->net.last_errno;
|
||||
|
||||
strmake(buff, thd->net.last_error, sizeof(buff)-1);
|
||||
thd->query_error= 0;
|
||||
thd->spcont= 0;
|
||||
thd->lex->current_select= 0;
|
||||
thd->net.last_error[0]= 0;
|
||||
|
||||
/* Fill up strucutures that print_error may need */
|
||||
dummy_table.s->path= path;
|
||||
dummy_table.alias= alias;
|
||||
|
||||
file->print_error(error, 0);
|
||||
strmake(new_error, thd->net.last_error, sizeof(buff)-1);
|
||||
|
||||
/* restore thd */
|
||||
thd->query_error= query_error;
|
||||
thd->spcont= spcont;
|
||||
thd->lex->current_select= current_select;
|
||||
thd->net.last_errno= last_errno;
|
||||
strmake(thd->net.last_error, buff, sizeof(buff)-1);
|
||||
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, new_error);
|
||||
}
|
||||
delete file;
|
||||
return error;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1320,7 +1369,16 @@ ulonglong handler::get_auto_increment()
|
|||
return nr;
|
||||
}
|
||||
|
||||
/* Print error that we got from handler function */
|
||||
|
||||
/*
|
||||
Print error that we got from handler function
|
||||
|
||||
NOTE:
|
||||
In case of delete table it's only safe to use the following parts of
|
||||
the 'table' structure:
|
||||
table->s->path
|
||||
table->alias
|
||||
*/
|
||||
|
||||
void handler::print_error(int error, myf errflag)
|
||||
{
|
||||
|
|
@ -1499,16 +1557,38 @@ uint handler::get_dup_key(int error)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Delete all files with extension from bas_ext()
|
||||
|
||||
SYNOPSIS
|
||||
delete_table()
|
||||
name Base name of table
|
||||
|
||||
NOTES
|
||||
We assume that the handler may return more extensions than
|
||||
was actually used for the file.
|
||||
|
||||
RETURN
|
||||
0 If we successfully deleted at least one file from base_ext and
|
||||
didn't get any other errors than ENOENT
|
||||
# Error from delete_file()
|
||||
*/
|
||||
|
||||
int handler::delete_table(const char *name)
|
||||
{
|
||||
int error= 0;
|
||||
int enoent_or_zero= ENOENT; // Error if no file was deleted
|
||||
|
||||
for (const char **ext=bas_ext(); *ext ; ext++)
|
||||
{
|
||||
if (delete_file(name,*ext,2))
|
||||
{
|
||||
if ((error=errno) != ENOENT)
|
||||
if ((error= my_errno) != ENOENT)
|
||||
break;
|
||||
}
|
||||
else
|
||||
enoent_or_zero= 0; // No error for ENOENT
|
||||
error= enoent_or_zero;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,11 +217,13 @@ struct xid_t {
|
|||
bool eq(long g, long b, const char *d)
|
||||
{ return g == gtrid_length && b == bqual_length && !memcmp(d, data, g+b); }
|
||||
void set(LEX_STRING *l) { set(l->length, 0, l->str); }
|
||||
void set(ulonglong l)
|
||||
void set(ulonglong xid)
|
||||
{
|
||||
my_xid tmp;
|
||||
set(MYSQL_XID_PREFIX_LEN, 0, MYSQL_XID_PREFIX);
|
||||
*(ulong*)(data+MYSQL_XID_PREFIX_LEN)=server_id;
|
||||
*(my_xid*)(data+MYSQL_XID_OFFSET)=l;
|
||||
memcpy(data+MYSQL_XID_PREFIX_LEN, &server_id, sizeof(server_id));
|
||||
tmp= xid;
|
||||
memcpy(data+MYSQL_XID_OFFSET, &tmp, sizeof(tmp));
|
||||
gtrid_length=MYSQL_XID_GTRID_LEN;
|
||||
}
|
||||
void set(long g, long b, const char *d)
|
||||
|
|
@ -235,7 +237,9 @@ struct xid_t {
|
|||
void null() { formatID= -1; }
|
||||
my_xid quick_get_my_xid()
|
||||
{
|
||||
return *(my_xid*)(data+MYSQL_XID_OFFSET);
|
||||
my_xid tmp;
|
||||
memcpy(&tmp, data+MYSQL_XID_OFFSET, sizeof(tmp));
|
||||
return tmp;
|
||||
}
|
||||
my_xid get_my_xid()
|
||||
{
|
||||
|
|
@ -249,7 +253,11 @@ typedef struct xid_t XID;
|
|||
|
||||
/* for recover() handlerton call */
|
||||
#define MIN_XID_LIST_SIZE 128
|
||||
#ifdef SAFEMALLOC
|
||||
#define MAX_XID_LIST_SIZE 256
|
||||
#else
|
||||
#define MAX_XID_LIST_SIZE (1024*128)
|
||||
#endif
|
||||
|
||||
/*
|
||||
handlerton is a singleton structure - one instance per storage engine -
|
||||
|
|
@ -790,7 +798,8 @@ bool ha_flush_logs(void);
|
|||
void ha_drop_database(char* path);
|
||||
int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
|
||||
bool update_create_info);
|
||||
int ha_delete_table(enum db_type db_type, const char *path);
|
||||
int ha_delete_table(THD *thd, enum db_type db_type, const char *path,
|
||||
const char *alias, bool generate_warning);
|
||||
|
||||
/* discovery */
|
||||
int ha_create_table_from_engine(THD* thd, const char *db, const char *name,
|
||||
|
|
|
|||
|
|
@ -4349,7 +4349,7 @@ my_decimal *Item_cache_real::val_decimal(my_decimal *decimal_val)
|
|||
void Item_cache_decimal::store(Item *item)
|
||||
{
|
||||
my_decimal *val= item->val_decimal_result(&decimal_value);
|
||||
if (val != &decimal_value)
|
||||
if (val != &decimal_value && !item->null_value)
|
||||
my_decimal2decimal(val, &decimal_value);
|
||||
null_value= item->null_value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3195,7 +3195,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
|
|||
entry->value=0;
|
||||
entry->length=0;
|
||||
entry->update_query_id=0;
|
||||
entry->collation.set(NULL, DERIVATION_NONE);
|
||||
entry->collation.set(NULL, DERIVATION_IMPLICIT);
|
||||
/*
|
||||
If we are here, we were called from a SET or a query which sets a
|
||||
variable. Imagine it is this:
|
||||
|
|
@ -3253,8 +3253,8 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables,
|
|||
and the variable has previously been initialized.
|
||||
*/
|
||||
if (!entry->collation.collation || !args[0]->null_value)
|
||||
entry->collation.set(args[0]->collation);
|
||||
collation.set(entry->collation);
|
||||
entry->collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT);
|
||||
collation.set(entry->collation.collation, DERIVATION_IMPLICIT);
|
||||
cached_result_type= args[0]->result_type();
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -3266,7 +3266,7 @@ Item_func_set_user_var::fix_length_and_dec()
|
|||
maybe_null=args[0]->maybe_null;
|
||||
max_length=args[0]->max_length;
|
||||
decimals=args[0]->decimals;
|
||||
collation.set(args[0]->collation);
|
||||
collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3542,7 +3542,7 @@ Item_func_set_user_var::update()
|
|||
res= update_hash((void*) save_result.vstr->ptr(),
|
||||
save_result.vstr->length(), STRING_RESULT,
|
||||
save_result.vstr->charset(),
|
||||
args[0]->collation.derivation);
|
||||
DERIVATION_IMPLICIT);
|
||||
break;
|
||||
}
|
||||
case DECIMAL_RESULT:
|
||||
|
|
|
|||
|
|
@ -656,7 +656,8 @@ my_decimal *Item_sum_sum_distinct::val_decimal(my_decimal *fake)
|
|||
else
|
||||
{
|
||||
double real= val_real();
|
||||
double2my_decimal(E_DEC_FATAL_ERROR, real, dec_buffs + curr_dec_buff);
|
||||
curr_dec_buff= 0;
|
||||
double2my_decimal(E_DEC_FATAL_ERROR, real, dec_buffs);
|
||||
}
|
||||
return(dec_buffs + curr_dec_buff);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -691,16 +691,24 @@ public:
|
|||
{
|
||||
int err_not_used;
|
||||
char *end_not_used;
|
||||
String *res; res=val_str(&str_value);
|
||||
String *res;
|
||||
res=val_str(&str_value);
|
||||
return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),
|
||||
&end_not_used, &err_not_used) : 0.0;
|
||||
}
|
||||
longlong val_int()
|
||||
{
|
||||
int err_not_used;
|
||||
String *res; res=val_str(&str_value);
|
||||
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,
|
||||
(char**) 0, &err_not_used) : (longlong) 0;
|
||||
char *end;
|
||||
String *res;
|
||||
longlong value;
|
||||
CHARSET_INFO *cs;
|
||||
|
||||
if (!(res= val_str(&str_value)))
|
||||
return 0; /* Null value */
|
||||
cs= res->charset();
|
||||
end= (char*) res->ptr()+res->length();
|
||||
return cs->cset->my_strtoll10(cs, res->ptr(), &end, &err_not_used);
|
||||
}
|
||||
my_decimal *val_decimal(my_decimal *dec);
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
|
|
|
|||
119
sql/log.cc
119
sql/log.cc
|
|
@ -920,6 +920,13 @@ bool MYSQL_LOG::reset_logs(THD* thd)
|
|||
*/
|
||||
pthread_mutex_lock(&LOCK_log);
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
/*
|
||||
The following mutex is needed to ensure that no threads call
|
||||
'delete thd' as we would then risk missing a 'rollback' from this
|
||||
thread. If the transaction involved MyISAM tables, it should go
|
||||
into binlog even on rollback.
|
||||
*/
|
||||
(void) pthread_mutex_lock(&LOCK_thread_count);
|
||||
|
||||
/* Save variables so that we can reopen the log */
|
||||
save_name=name;
|
||||
|
|
@ -953,6 +960,7 @@ bool MYSQL_LOG::reset_logs(THD* thd)
|
|||
my_free((gptr) save_name, MYF(0));
|
||||
|
||||
err:
|
||||
(void) pthread_mutex_unlock(&LOCK_thread_count);
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
pthread_mutex_unlock(&LOCK_log);
|
||||
DBUG_RETURN(error);
|
||||
|
|
@ -1552,8 +1560,7 @@ bool MYSQL_LOG::write(Log_event* event_info)
|
|||
{
|
||||
THD *thd= event_info->thd;
|
||||
bool error= 1;
|
||||
bool should_rotate = 0;
|
||||
DBUG_ENTER("MYSQL_LOG::write(event)");
|
||||
DBUG_ENTER("MYSQL_LOG::write(Log_event *)");
|
||||
|
||||
pthread_mutex_lock(&LOCK_log);
|
||||
|
||||
|
|
@ -1601,7 +1608,8 @@ bool MYSQL_LOG::write(Log_event* event_info)
|
|||
{
|
||||
thd->ha_data[binlog_hton.slot]= trans_log= (IO_CACHE *)
|
||||
my_malloc(sizeof(IO_CACHE), MYF(MY_ZEROFILL));
|
||||
if (!trans_log || open_cached_file(trans_log, mysql_tmpdir, LOG_PREFIX,
|
||||
if (!trans_log || open_cached_file(trans_log, mysql_tmpdir,
|
||||
LOG_PREFIX,
|
||||
binlog_cache_size, MYF(MY_WME)))
|
||||
{
|
||||
my_free((gptr)trans_log, MYF(MY_ALLOW_ZERO_PTR));
|
||||
|
|
@ -1610,12 +1618,14 @@ bool MYSQL_LOG::write(Log_event* event_info)
|
|||
}
|
||||
trans_log->end_of_file= max_binlog_cache_size;
|
||||
trans_register_ha(thd,
|
||||
thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN),
|
||||
thd->options & (OPTION_NOT_AUTOCOMMIT |
|
||||
OPTION_BEGIN),
|
||||
&binlog_hton);
|
||||
}
|
||||
else if (!my_b_tell(trans_log))
|
||||
trans_register_ha(thd,
|
||||
thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN),
|
||||
thd->options & (OPTION_NOT_AUTOCOMMIT |
|
||||
OPTION_BEGIN),
|
||||
&binlog_hton);
|
||||
file= trans_log;
|
||||
}
|
||||
|
|
@ -1734,10 +1744,6 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
|
|||
{
|
||||
if (flush_io_cache(file) || sync_binlog(file))
|
||||
goto err;
|
||||
|
||||
/* check automatic rotation; */
|
||||
DBUG_PRINT("info",("max_size: %lu",max_size));
|
||||
should_rotate= (my_b_tell(file) >= (my_off_t) max_size);
|
||||
}
|
||||
error=0;
|
||||
|
||||
|
|
@ -1751,28 +1757,39 @@ err:
|
|||
write_error=1;
|
||||
}
|
||||
if (file == &log_file)
|
||||
signal_update();
|
||||
if (should_rotate)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(0); // inside mutex
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
signal_update();
|
||||
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&LOCK_log);
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (should_rotate && expire_logs_days)
|
||||
{
|
||||
long purge_time= time(0) - expire_logs_days*24*60*60;
|
||||
if (purge_time >= 0)
|
||||
error= purge_logs_before_date(purge_time);
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
void MYSQL_LOG::rotate_and_purge(uint flags)
|
||||
{
|
||||
if (!prepared_xids && // see new_file() for the explanation
|
||||
((flags & RP_FORCE_ROTATE) ||
|
||||
(my_b_tell(&log_file) >= (my_off_t) max_size)))
|
||||
{
|
||||
if (flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED));
|
||||
if (flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
#ifdef HAVE_REPLICATION
|
||||
// QQ why do we need #ifdef here ???
|
||||
if (expire_logs_days)
|
||||
{
|
||||
long purge_time= time(0) - expire_logs_days*24*60*60;
|
||||
if (purge_time >= 0)
|
||||
purge_logs_before_date(purge_time);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
uint MYSQL_LOG::next_file_id()
|
||||
{
|
||||
|
|
@ -1797,23 +1814,19 @@ uint MYSQL_LOG::next_file_id()
|
|||
- The thing in the cache is always a complete transaction
|
||||
- 'cache' needs to be reinitialized after this functions returns.
|
||||
|
||||
TODO
|
||||
fix it to become atomic - either the complete cache is added to binlog
|
||||
or nothing (other storage engines rely on this, doing a ROLLBACK)
|
||||
|
||||
IMPLEMENTATION
|
||||
- To support transaction over replication, we wrap the transaction
|
||||
with BEGIN/COMMIT or BEGIN/ROLLBACK in the binary log.
|
||||
We want to write a BEGIN/ROLLBACK block when a non-transactional table was
|
||||
updated in a transaction which was rolled back. This is to ensure that the
|
||||
same updates are run on the slave.
|
||||
We want to write a BEGIN/ROLLBACK block when a non-transactional table
|
||||
was updated in a transaction which was rolled back. This is to ensure
|
||||
that the same updates are run on the slave.
|
||||
*/
|
||||
|
||||
bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache)
|
||||
{
|
||||
bool should_rotate= 0, error= 0;
|
||||
bool error= 0;
|
||||
VOID(pthread_mutex_lock(&LOCK_log));
|
||||
DBUG_ENTER("MYSQL_LOG::write(cache");
|
||||
DBUG_ENTER("MYSQL_LOG::write(THD *, IO_CACHE *)");
|
||||
|
||||
if (likely(is_open())) // Should always be true
|
||||
{
|
||||
|
|
@ -1869,25 +1882,10 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache)
|
|||
}
|
||||
signal_update();
|
||||
DBUG_PRINT("info",("max_size: %lu",max_size));
|
||||
if (should_rotate= (my_b_tell(&log_file) >= (my_off_t) max_size))
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(0); // inside mutex
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
}
|
||||
|
||||
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&LOCK_log));
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (should_rotate && expire_logs_days)
|
||||
{
|
||||
long purge_time= time(0) - expire_logs_days*24*60*60;
|
||||
if (purge_time >= 0)
|
||||
error= purge_logs_before_date(purge_time);
|
||||
}
|
||||
#endif
|
||||
|
||||
DBUG_RETURN(error);
|
||||
|
||||
err:
|
||||
|
|
@ -2475,15 +2473,13 @@ int TC_LOG_MMAP::open(const char *opt_name)
|
|||
DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0);
|
||||
|
||||
fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME);
|
||||
fd= my_open(logname, O_RDWR, MYF(0));
|
||||
if (fd == -1)
|
||||
if ((fd= my_open(logname, O_RDWR, MYF(0))) < 0)
|
||||
{
|
||||
if (my_errno != ENOENT)
|
||||
goto err;
|
||||
if (using_heuristic_recover())
|
||||
return 1;
|
||||
fd= my_create(logname, O_RDWR, 0, MYF(MY_WME));
|
||||
if (fd == -1)
|
||||
if ((fd= my_create(logname, O_RDWR, 0, MYF(MY_WME))) < 0)
|
||||
goto err;
|
||||
inited=1;
|
||||
file_length= opt_tc_log_size;
|
||||
|
|
@ -2821,7 +2817,7 @@ int TC_LOG_MMAP::recover()
|
|||
*/
|
||||
if (data[sizeof(tc_log_magic)] != total_ha_2pc)
|
||||
{
|
||||
sql_print_error("Recovery failed! You must have enabled "
|
||||
sql_print_error("Recovery failed! You must enable "
|
||||
"exactly %d storage engines that support "
|
||||
"two-phase commit protocol",
|
||||
data[sizeof(tc_log_magic)]);
|
||||
|
|
@ -2907,7 +2903,12 @@ int TC_LOG_BINLOG::open(const char *opt_name)
|
|||
pthread_cond_init (&COND_prep_xids, 0);
|
||||
|
||||
if (using_heuristic_recover())
|
||||
{
|
||||
/* generate a new binlog to mask a corrupted one */
|
||||
open(opt_name, LOG_BIN, 0, WRITE_CACHE, 0, max_binlog_size, 0);
|
||||
cleanup();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((error= find_log_pos(&log_info, NullS, 1)))
|
||||
{
|
||||
|
|
@ -2930,15 +2931,16 @@ int TC_LOG_BINLOG::open(const char *opt_name)
|
|||
if (! fdle.is_valid())
|
||||
goto err;
|
||||
|
||||
for (error= 0; !error ;)
|
||||
do
|
||||
{
|
||||
strnmov(log_name, log_info.log_file_name, sizeof(log_name));
|
||||
if ((error= find_next_log(&log_info, 1)) != LOG_INFO_EOF)
|
||||
strmake(log_name, log_info.log_file_name, sizeof(log_name)-1);
|
||||
} while (!(error= find_next_log(&log_info, 1)));
|
||||
|
||||
if (error != LOG_INFO_EOF)
|
||||
{
|
||||
sql_print_error("find_log_pos() failed (error: %d)", error);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if ((file= open_binlog(&log, log_name, &errmsg)) < 0)
|
||||
{
|
||||
|
|
@ -2993,6 +2995,7 @@ void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
|
|||
{
|
||||
if (thread_safe_dec_and_test(prepared_xids, &LOCK_prep_xids))
|
||||
pthread_cond_signal(&COND_prep_xids);
|
||||
rotate_and_purge(0); // in case ::write() was not able to rotate
|
||||
}
|
||||
|
||||
int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
|
||||
|
|
@ -3002,11 +3005,11 @@ int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
|
|||
MEM_ROOT mem_root;
|
||||
|
||||
if (! fdle->is_valid() ||
|
||||
hash_init(&xids, &my_charset_bin, tc_log_page_size/3, 0,
|
||||
hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0,
|
||||
sizeof(my_xid), 0, 0, MYF(0)))
|
||||
goto err1;
|
||||
|
||||
init_alloc_root(&mem_root, tc_log_page_size, tc_log_page_size);
|
||||
init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE);
|
||||
|
||||
fdle->flags&= ~LOG_EVENT_BINLOG_IN_USE_F; // abort on the first error
|
||||
|
||||
|
|
|
|||
|
|
@ -1450,7 +1450,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
|
|||
thd->query_id = next_query_id();
|
||||
VOID(pthread_mutex_unlock(&LOCK_thread_count));
|
||||
thd->variables.pseudo_thread_id= thread_id; // for temp tables
|
||||
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
|
||||
DBUG_PRINT("query",("%s",thd->query));
|
||||
|
||||
if (ignored_error_code((expected_error= error_code)) ||
|
||||
|
|
@ -1535,6 +1534,10 @@ START SLAVE; . Query: '%s'", expected_error, thd->query);
|
|||
goto end;
|
||||
}
|
||||
|
||||
/* If the query was not ignored, it is printed to the general log */
|
||||
if (thd->net.last_errno != ER_SLAVE_IGNORED_TABLE)
|
||||
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
|
||||
|
||||
compare_errors:
|
||||
|
||||
/*
|
||||
|
|
@ -3099,12 +3102,14 @@ void Xid_log_event::pack_info(Protocol *protocol)
|
|||
we don't care about actual values of xids as long as
|
||||
identical numbers compare identically
|
||||
*/
|
||||
Xid_log_event::Xid_log_event(const char* buf,
|
||||
|
||||
Xid_log_event::
|
||||
Xid_log_event(const char* buf,
|
||||
const Format_description_log_event *description_event)
|
||||
:Log_event(buf, description_event)
|
||||
{
|
||||
buf+= description_event->common_header_len;
|
||||
xid=*((my_xid *)buf);
|
||||
memcpy((char*) &xid, buf, sizeof(xid));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -3137,6 +3142,7 @@ int Xid_log_event::exec_event(struct st_relay_log_info* rli)
|
|||
{
|
||||
rli->inc_event_relay_log_pos();
|
||||
/* For a slave Xid_log_event is COMMIT */
|
||||
mysql_log.write(thd,COM_QUERY,"COMMIT /* implicit, from Xid_log_event */");
|
||||
return end_trans(thd, COMMIT);
|
||||
}
|
||||
#endif /* !MYSQL_CLIENT */
|
||||
|
|
@ -3467,7 +3473,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
|
|||
0 can be passed as last argument (reference on item)
|
||||
*/
|
||||
e.fix_fields(thd, 0, 0);
|
||||
e.update_hash(val, val_len, type, charset, DERIVATION_NONE);
|
||||
/*
|
||||
A variable can just be considered as a table with
|
||||
a single record and with a single column. Thus, like
|
||||
a column value, it could always have IMPLICIT derivation.
|
||||
*/
|
||||
e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT);
|
||||
free_root(thd->mem_root,0);
|
||||
|
||||
rli->inc_event_relay_log_pos();
|
||||
|
|
|
|||
|
|
@ -254,6 +254,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
|
|||
/* The rest of the file is included in the server only */
|
||||
#ifndef MYSQL_CLIENT
|
||||
|
||||
/* If set to 0, then the thread will ignore all warnings with level notes.
|
||||
Set by executing SET SQL_NOTES=1 */
|
||||
#define OPTION_SQL_NOTES (1L << 31)
|
||||
|
||||
/* Bits for different SQL modes modes (including ANSI mode) */
|
||||
#define MODE_REAL_AS_FLOAT 1
|
||||
#define MODE_PIPES_AS_CONCAT 2
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster;
|
|||
const char *opt_ndbcluster_connectstring= 0;
|
||||
const char *opt_ndb_connectstring= 0;
|
||||
char opt_ndb_constrbuf[1024];
|
||||
unsigned opt_ndb_constrbuf_len;
|
||||
unsigned opt_ndb_constrbuf_len= 0;
|
||||
my_bool opt_ndb_shm, opt_ndb_optimized_node_selection;
|
||||
ulong opt_ndb_cache_check_time;
|
||||
const char *opt_ndb_mgmd;
|
||||
|
|
@ -321,12 +321,14 @@ my_bool opt_old_style_user_limits= 0;
|
|||
volatile bool mqh_used = 0;
|
||||
my_bool sp_automatic_privileges= 1;
|
||||
|
||||
#ifdef HAVE_INITGROUPS
|
||||
static bool calling_initgroups= FALSE; /* Used in SIGSEGV handler. */
|
||||
#endif
|
||||
uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
|
||||
uint delay_key_write_options, protocol_version;
|
||||
uint lower_case_table_names;
|
||||
uint tc_heuristic_recover= 0;
|
||||
uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
|
||||
|
||||
ulong back_log, connect_timeout, concurrency;
|
||||
ulong server_id, thd_startup_options;
|
||||
ulong table_cache_size, thread_stack, thread_stack_min, what_to_log;
|
||||
|
|
@ -1171,7 +1173,15 @@ static void set_user(const char *user, struct passwd *user_info)
|
|||
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
|
||||
DBUG_ASSERT(user_info);
|
||||
#ifdef HAVE_INITGROUPS
|
||||
/*
|
||||
We can get a SIGSEGV when calling initgroups() on some systems when NSS
|
||||
is configured to use LDAP and the server is statically linked. We set
|
||||
calling_initgroups as a flag to the SIGSEGV handler that is then used to
|
||||
output a specific message to help the user resolve this problem.
|
||||
*/
|
||||
calling_initgroups= TRUE;
|
||||
initgroups((char*) user, user_info->pw_gid);
|
||||
calling_initgroups= FALSE;
|
||||
#endif
|
||||
if (setgid(user_info->pw_gid) == -1)
|
||||
{
|
||||
|
|
@ -1926,6 +1936,17 @@ information that should help you find out what is causing the crash.\n");
|
|||
fflush(stderr);
|
||||
#endif /* HAVE_STACKTRACE */
|
||||
|
||||
#ifdef HAVE_INITGROUPS
|
||||
if (calling_initgroups)
|
||||
fprintf(stderr, "\n\
|
||||
This crash occured while the server was calling initgroups(). This is\n\
|
||||
often due to the use of a mysqld that is statically linked against glibc\n\
|
||||
and configured to use LDAP in /etc/nsswitch.conf. You will need to either\n\
|
||||
upgrade to a version of glibc that does not have this problem (2.3.4 or\n\
|
||||
later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\
|
||||
mysqld that is not statically linked.\n");
|
||||
#endif
|
||||
|
||||
if (test_flags & TEST_CORE_ON_SIGNAL)
|
||||
{
|
||||
fprintf(stderr, "Writing a core file\n");
|
||||
|
|
@ -2743,7 +2764,7 @@ server.");
|
|||
(TC_LOG *)&tc_log_mmap :
|
||||
(TC_LOG *)&tc_log_dummy;
|
||||
|
||||
if (tc_log->open(opt_tc_log_file))
|
||||
if (tc_log->open(opt_bin_logname))
|
||||
{
|
||||
sql_print_error("Can't init tc log");
|
||||
unireg_abort(1);
|
||||
|
|
@ -4669,7 +4690,7 @@ Disable with --skip-ndbcluster (will save memory).",
|
|||
(gptr*) &opt_ndb_optimized_node_selection,
|
||||
(gptr*) &opt_ndb_optimized_node_selection,
|
||||
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{ "ndb_cache_check_time", OPT_NDB_CACHE_CHECK_TIME,
|
||||
{ "ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
|
||||
"A dedicated thread is created to update cached commit count value"
|
||||
" at the given interval.",
|
||||
(gptr*) &opt_ndb_cache_check_time, (gptr*) &opt_ndb_cache_check_time,
|
||||
|
|
@ -5806,7 +5827,8 @@ static void mysql_init_variables(void)
|
|||
language_ptr= language;
|
||||
mysql_data_home= mysql_real_data_home;
|
||||
thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
|
||||
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE);
|
||||
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE |
|
||||
OPTION_SQL_NOTES);
|
||||
protocol_version= PROTOCOL_VERSION;
|
||||
what_to_log= ~ (1L << (uint) COM_TIME);
|
||||
refresh_version= flush_version= 1L; /* Increments on each reload */
|
||||
|
|
|
|||
|
|
@ -2562,7 +2562,8 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info,
|
|||
char *key_ptr= (char*) key_val;
|
||||
SEL_ARG *sel_arg, *tuple_arg= NULL;
|
||||
bool cur_covered;
|
||||
bool prev_covered= bitmap_is_set(&info->covered_fields, key_part->fieldnr);
|
||||
bool prev_covered= test(bitmap_is_set(&info->covered_fields,
|
||||
key_part->fieldnr));
|
||||
key_range min_range;
|
||||
key_range max_range;
|
||||
min_range.key= (byte*) key_val;
|
||||
|
|
@ -2575,7 +2576,9 @@ static double ror_scan_selectivity(const ROR_INTERSECT_INFO *info,
|
|||
for(i= 0, sel_arg= scan->sel_arg; sel_arg;
|
||||
i++, sel_arg= sel_arg->next_key_part)
|
||||
{
|
||||
cur_covered= bitmap_is_set(&info->covered_fields, (key_part + i)->fieldnr);
|
||||
DBUG_PRINT("info",("sel_arg step"));
|
||||
cur_covered= test(bitmap_is_set(&info->covered_fields,
|
||||
(key_part + i)->fieldnr));
|
||||
if (cur_covered != prev_covered)
|
||||
{
|
||||
/* create (part1val, ..., part{n-1}val) tuple. */
|
||||
|
|
|
|||
|
|
@ -464,6 +464,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin",
|
|||
static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
|
||||
set_option_bit,
|
||||
OPTION_WARNINGS);
|
||||
static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
|
||||
set_option_bit,
|
||||
OPTION_SQL_NOTES);
|
||||
static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
|
||||
set_option_bit,
|
||||
OPTION_AUTO_IS_NULL);
|
||||
|
|
@ -658,6 +661,7 @@ sys_var *sys_variables[]=
|
|||
&sys_sql_max_join_size,
|
||||
&sys_sql_mode,
|
||||
&sys_sql_warnings,
|
||||
&sys_sql_notes,
|
||||
&sys_storage_engine,
|
||||
#ifdef HAVE_REPLICATION
|
||||
&sys_sync_binlog_period,
|
||||
|
|
@ -935,6 +939,8 @@ struct show_var_st init_vars[]= {
|
|||
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
|
||||
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
|
||||
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
|
||||
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
|
||||
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
|
||||
#ifdef HAVE_REPLICATION
|
||||
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
|
||||
{sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
|
||||
|
|
|
|||
|
|
@ -504,6 +504,7 @@ sp_head::execute(THD *thd)
|
|||
break;
|
||||
DBUG_PRINT("execute", ("Instruction %u", ip));
|
||||
ret= i->execute(thd, &ip);
|
||||
thd->rollback_item_tree_changes();
|
||||
if (i->free_list)
|
||||
cleanup_items(i->free_list);
|
||||
// Check if an exception has occurred and a handler has been found
|
||||
|
|
@ -1195,7 +1196,6 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
|
|||
res= mysql_execute_command(thd);
|
||||
|
||||
lex->unit.cleanup();
|
||||
thd->rollback_item_tree_changes();
|
||||
if (thd->lock || thd->open_tables || thd->derived_tables)
|
||||
{
|
||||
thd->proc_info="closing tables";
|
||||
|
|
|
|||
|
|
@ -204,20 +204,17 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
if (lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
We make a temporary copy of the database, force it to lower case,
|
||||
and then copy it back over the original name. We can't just update
|
||||
the host.db pointer, because tmp_name is allocated on the stack.
|
||||
convert db to lower case and give a warning if the db wasn't
|
||||
already in lower case
|
||||
*/
|
||||
(void) strmov(tmp_name, host.db);
|
||||
my_casedn_str(files_charset_info, tmp_name);
|
||||
my_casedn_str(files_charset_info, host.db);
|
||||
if (strcmp(host.db, tmp_name) != 0)
|
||||
{
|
||||
sql_print_warning("'host' entry '%s|%s' had database in mixed "
|
||||
"case that has been forced to lowercase because "
|
||||
"lower_case_table_names is set.",
|
||||
"lower_case_table_names is set. It will not be "
|
||||
"possible to remove this privilege using REVOKE.",
|
||||
host.host.hostname, host.db);
|
||||
(void)strmov(host.db, tmp_name);
|
||||
}
|
||||
}
|
||||
host.access= get_access(table,2);
|
||||
host.access= fix_rights_for_db(host.access);
|
||||
|
|
@ -432,19 +429,18 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
if (lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
We make a temporary copy of the database, force it to lower case,
|
||||
and then copy it back over the original name. We can't just update
|
||||
the db.db pointer, because tmp_name is allocated on the stack.
|
||||
convert db to lower case and give a warning if the db wasn't
|
||||
already in lower case
|
||||
*/
|
||||
(void)strmov(tmp_name, db.db);
|
||||
my_casedn_str(files_charset_info, tmp_name);
|
||||
my_casedn_str(files_charset_info, db.db);
|
||||
if (strcmp(db.db, tmp_name) != 0)
|
||||
{
|
||||
sql_print_warning("'db' entry '%s %s@%s' had database in mixed "
|
||||
"case that has been forced to lowercase because "
|
||||
"lower_case_table_names is set.",
|
||||
"lower_case_table_names is set. It will not be "
|
||||
"possible to remove this privilege using REVOKE.",
|
||||
db.db, db.user, db.host.hostname, db.host.hostname);
|
||||
(void)strmov(db.db, tmp_name);
|
||||
}
|
||||
}
|
||||
db.sort=get_sort(3,db.host.hostname,db.db,db.user);
|
||||
|
|
|
|||
|
|
@ -3592,23 +3592,20 @@ static void mysql_rm_tmp_tables(void)
|
|||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
** Invalidate any cache entries that are for some DB
|
||||
** We can't use hash_delete when looping hash_elements. We mark them first
|
||||
** and afterwards delete those marked unused.
|
||||
Invalidate any cache entries that are for some DB
|
||||
|
||||
SYNOPSIS
|
||||
remove_db_from_cache()
|
||||
db Database name. This will be in lower case if
|
||||
lower_case_table_name is set
|
||||
|
||||
NOTE:
|
||||
We can't use hash_delete when looping hash_elements. We mark them first
|
||||
and afterwards delete those marked unused.
|
||||
*/
|
||||
|
||||
void remove_db_from_cache(const char *db)
|
||||
{
|
||||
char name_buff[NAME_LEN+1];
|
||||
if (db && lower_case_table_names)
|
||||
{
|
||||
/*
|
||||
convert database to lower case for comparision.
|
||||
*/
|
||||
strmake(name_buff, db, sizeof(name_buff)-1);
|
||||
my_casedn_str(files_charset_info, name_buff);
|
||||
db= name_buff;
|
||||
}
|
||||
for (uint idx=0 ; idx < open_cache.records ; idx++)
|
||||
{
|
||||
TABLE *table=(TABLE*) hash_element(&open_cache,idx);
|
||||
|
|
|
|||
|
|
@ -83,14 +83,14 @@ class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
|
|||
#ifdef HAVE_MMAP
|
||||
class TC_LOG_MMAP: public TC_LOG
|
||||
{
|
||||
private:
|
||||
|
||||
public: // only to keep Sun Forte on sol9x86 happy
|
||||
typedef enum {
|
||||
POOL, // page is in pool
|
||||
ERROR, // last sync failed
|
||||
DIRTY // new xids added since last sync
|
||||
} PAGE_STATE;
|
||||
|
||||
private:
|
||||
typedef struct st_page {
|
||||
struct st_page *next; // page a linked in a fifo queue
|
||||
my_xid *start, *end; // usable area of a page
|
||||
|
|
@ -174,6 +174,9 @@ typedef struct st_user_var_events
|
|||
uint charset_number;
|
||||
} BINLOG_USER_VAR_EVENT;
|
||||
|
||||
#define RP_LOCK_LOG_IS_ALREADY_LOCKED 1
|
||||
#define RP_FORCE_ROTATE 2
|
||||
|
||||
class Log_event;
|
||||
|
||||
/*
|
||||
|
|
@ -300,7 +303,7 @@ public:
|
|||
}
|
||||
bool open_index_file(const char *index_file_name_arg,
|
||||
const char *log_name);
|
||||
void new_file(bool need_lock= 1);
|
||||
void new_file(bool need_lock);
|
||||
bool write(THD *thd, enum enum_server_command command,
|
||||
const char *format,...);
|
||||
bool write(THD *thd, const char *query, uint query_length,
|
||||
|
|
@ -319,6 +322,7 @@ public:
|
|||
void make_log_name(char* buf, const char* log_ident);
|
||||
bool is_active(const char* log_file_name);
|
||||
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
|
||||
void rotate_and_purge(uint flags);
|
||||
int purge_logs(const char *to_log, bool included,
|
||||
bool need_mutex, bool need_update_threads,
|
||||
ulonglong *decrease_log_space);
|
||||
|
|
@ -1070,6 +1074,7 @@ public:
|
|||
void cleanup()
|
||||
{
|
||||
changed_tables= 0;
|
||||
savepoints= 0;
|
||||
#ifdef USING_TRANSACTIONS
|
||||
free_root(&mem_root,MYF(MY_KEEP_PREALLOC));
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -576,7 +576,8 @@ exit2:
|
|||
mysql_rm_db()
|
||||
thd Thread handle
|
||||
db Database name in the case given by user
|
||||
It's already validated when we come here
|
||||
It's already validated and set to lower case
|
||||
(if needed) when we come here
|
||||
if_exists Don't give error if database doesn't exists
|
||||
silent Don't generate errors
|
||||
|
||||
|
|
@ -589,7 +590,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
|
|||
{
|
||||
long deleted=0;
|
||||
int error= 0;
|
||||
char path[FN_REFLEN+16], tmp_db[NAME_LEN+1];
|
||||
char path[FN_REFLEN+16];
|
||||
MY_DIR *dirp;
|
||||
uint length;
|
||||
DBUG_ENTER("mysql_rm_db");
|
||||
|
|
@ -636,13 +637,6 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
|
|||
error = 0;
|
||||
}
|
||||
}
|
||||
if (lower_case_table_names)
|
||||
{
|
||||
/* Convert database to lower case */
|
||||
strmov(tmp_db, db);
|
||||
my_casedn_str(files_charset_info, tmp_db);
|
||||
db= tmp_db;
|
||||
}
|
||||
if (!silent && deleted>=0)
|
||||
{
|
||||
const char *query;
|
||||
|
|
|
|||
|
|
@ -124,10 +124,16 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
|
|||
/*
|
||||
Temp table is created so that it hounours if UNION without ALL is to be
|
||||
processed
|
||||
|
||||
As 'distinct' parameter we always pass FALSE (0), because underlying
|
||||
query will control distinct condition by itself. Correct test of
|
||||
distinct underlying query will be is_union &&
|
||||
!unit->union_distinct->next_select() (i.e. it is union and last distinct
|
||||
SELECT is last SELECT of UNION).
|
||||
*/
|
||||
if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param,
|
||||
unit->types, (ORDER*) 0,
|
||||
is_union && unit->union_distinct, 1,
|
||||
FALSE, 1,
|
||||
(first_select->options | thd->options |
|
||||
TMP_TABLE_ALL_COLUMNS),
|
||||
HA_POS_ERROR,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue