Merge mysql.com:/misc/mysql/mysql-5.1
into mysql.com:/misc/mysql/mysql-5.1-opt CMakeLists.txt: Auto merged configure.in: Auto merged include/config-win.h: Auto merged include/my_global.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_db.cc: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged
This commit is contained in:
commit
ea4c84eada
@ -104,6 +104,10 @@ SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
||||
|
||||
#TODO: update the code and remove the disabled warnings
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
|
||||
|
@ -536,6 +536,17 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void wait_query_thread_end(struct st_connection *con)
|
||||
{
|
||||
if (!con->query_done)
|
||||
{
|
||||
pthread_mutex_lock(&con->mutex);
|
||||
while (!con->query_done)
|
||||
pthread_cond_wait(&con->cond, &con->mutex);
|
||||
pthread_mutex_unlock(&con->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
#else /*EMBEDDED_LIBRARY*/
|
||||
|
||||
#define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len)
|
||||
@ -4069,7 +4080,14 @@ void do_close_connection(struct st_command *command)
|
||||
con->mysql.net.vio = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
/*
|
||||
As query could be still executed in a separate theread
|
||||
we need to check if the query's thread was finished and probably wait
|
||||
(embedded-server specific)
|
||||
*/
|
||||
wait_query_thread_end(con);
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
if (con->stmt)
|
||||
mysql_stmt_close(con->stmt);
|
||||
con->stmt= 0;
|
||||
@ -4357,6 +4375,9 @@ void do_connect(struct st_command *command)
|
||||
(int) (sizeof(connections)/sizeof(struct st_connection)));
|
||||
}
|
||||
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
con_slot->query_done= 1;
|
||||
#endif
|
||||
if (!mysql_init(&con_slot->mysql))
|
||||
die("Failed on mysql_init()");
|
||||
if (opt_compress || con_compress)
|
||||
@ -5859,12 +5880,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
||||
query's thread was finished and probably wait
|
||||
*/
|
||||
else if (flags & QUERY_REAP_FLAG)
|
||||
{
|
||||
pthread_mutex_lock(&cn->mutex);
|
||||
while (!cn->query_done)
|
||||
pthread_cond_wait(&cn->cond, &cn->mutex);
|
||||
pthread_mutex_unlock(&cn->mutex);
|
||||
}
|
||||
wait_query_thread_end(cn);
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
if (!(flags & QUERY_REAP_FLAG))
|
||||
DBUG_VOID_RETURN;
|
||||
|
@ -158,14 +158,12 @@ typedef uint rf_SetTimer;
|
||||
|
||||
#define Socket_defined
|
||||
#define my_socket SOCKET
|
||||
#define bool BOOL
|
||||
#define SIGPIPE SIGINT
|
||||
#define RETQSORTTYPE void
|
||||
#define QSORT_TYPE_IS_VOID
|
||||
#define RETSIGTYPE void
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
#define my_socket_defined
|
||||
#define bool_defined
|
||||
#define byte_defined
|
||||
#define HUGE_PTR
|
||||
#define STDCALL __stdcall /* Used by libmysql.dll */
|
||||
@ -407,4 +405,4 @@ inline double ulonglong2double(ulonglong value)
|
||||
#define HAVE_CHARSET_ujis 1
|
||||
#define HAVE_CHARSET_utf8 1
|
||||
#define HAVE_UCA_COLLATIONS 1
|
||||
|
||||
#define HAVE_BOOL 1
|
||||
|
@ -1067,7 +1067,7 @@ typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
|
||||
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
|
||||
typedef int myf; /* Type of MyFlags in my_funcs */
|
||||
typedef char my_bool; /* Small bool */
|
||||
#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
|
||||
#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
|
||||
typedef char bool; /* Ordinary boolean values 0 1 */
|
||||
#endif
|
||||
/* Macros for converting *constants* to the right type */
|
||||
|
@ -4,14 +4,14 @@ SELECT @@session.sql_big_selects;
|
||||
1
|
||||
SELECT @@global.max_join_size;
|
||||
@@global.max_join_size
|
||||
18446744073709551615
|
||||
HA_POS_ERROR
|
||||
change_user
|
||||
SELECT @@session.sql_big_selects;
|
||||
@@session.sql_big_selects
|
||||
1
|
||||
SELECT @@global.max_join_size;
|
||||
@@global.max_join_size
|
||||
18446744073709551615
|
||||
HA_POS_ERROR
|
||||
SET @@global.max_join_size = 10000;
|
||||
SET @@session.max_join_size = default;
|
||||
change_user
|
||||
|
@ -72,6 +72,7 @@ flush tables with read lock;
|
||||
unlock tables;
|
||||
drop table t1, t2;
|
||||
set session low_priority_updates=default;
|
||||
select benchmark(200, (select sin(1))) > 1000;
|
||||
End of 5.0 tests
|
||||
set @old_general_log= @@general_log;
|
||||
set @old_read_only= @@read_only;
|
||||
|
@ -1410,4 +1410,10 @@ Note 1003 select (`test`.`t1`.`a` + 1) AS `y` from `test`.`t1` group by (`test`.
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
SET SQL_MODE=DEFAULT;
|
||||
CREATE TABLE t1(a DOUBLE);
|
||||
INSERT INTO t1 VALUES (10), (20);
|
||||
SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
|
||||
AVG(a) CAST(AVG(a) AS DECIMAL)
|
||||
15 15
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1471,11 +1471,22 @@ f6 bigint(20) NO 10
|
||||
f7 datetime NO NULL
|
||||
f8 datetime YES 2006-01-01 00:00:00
|
||||
drop table t1;
|
||||
End of 5.0 tests.
|
||||
show fields from information_schema.table_names;
|
||||
ERROR 42S02: Unknown table 'table_names' in information_schema
|
||||
show keys from information_schema.table_names;
|
||||
ERROR 42S02: Unknown table 'table_names' in information_schema
|
||||
USE information_schema;
|
||||
SET max_heap_table_size = 16384;
|
||||
CREATE TABLE test.t1( a INT );
|
||||
SELECT *
|
||||
FROM tables ta
|
||||
JOIN collations co ON ( co.collation_name = ta.table_catalog )
|
||||
JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
||||
DROP TABLE test.t1;
|
||||
SET max_heap_table_size = DEFAULT;
|
||||
USE test;
|
||||
End of 5.0 tests.
|
||||
select * from information_schema.engines WHERE ENGINE="MyISAM";
|
||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||
MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO
|
||||
|
@ -78,3 +78,14 @@ NULL NULL
|
||||
db-1 t-2
|
||||
NULL NULL
|
||||
drop database `db-1`;
|
||||
create table t1(id int primary key) engine = Innodb;
|
||||
create table t2(pid int, foreign key (pid) references t1(id)) engine = Innodb;
|
||||
set foreign_key_checks = 0;
|
||||
drop table t1;
|
||||
select UNIQUE_CONSTRAINT_NAME
|
||||
from information_schema.referential_constraints
|
||||
where constraint_schema = schema();
|
||||
UNIQUE_CONSTRAINT_NAME
|
||||
NULL
|
||||
drop table t2;
|
||||
set foreign_key_checks = 1;
|
||||
|
@ -842,6 +842,34 @@ Pos Instruction
|
||||
21 jump 3
|
||||
drop procedure proc_33618_h;
|
||||
drop procedure proc_33618_c;
|
||||
drop procedure if exists p_20906_a;
|
||||
drop procedure if exists p_20906_b;
|
||||
create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
|
||||
show procedure code p_20906_a;
|
||||
Pos Instruction
|
||||
0 stmt 31 "SET @a=@a+1"
|
||||
1 stmt 31 "SET @b=@b+1"
|
||||
set @a=1;
|
||||
set @b=1;
|
||||
call p_20906_a();
|
||||
select @a, @b;
|
||||
@a @b
|
||||
2 2
|
||||
create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
|
||||
show procedure code p_20906_b;
|
||||
Pos Instruction
|
||||
0 stmt 31 "SET @a=@a+1"
|
||||
1 stmt 31 "SET @b=@b+1"
|
||||
2 stmt 31 "SET @c=@c+1"
|
||||
set @a=1;
|
||||
set @b=1;
|
||||
set @c=1;
|
||||
call p_20906_b();
|
||||
select @a, @b, @c;
|
||||
@a @b @c
|
||||
2 2 2
|
||||
drop procedure p_20906_a;
|
||||
drop procedure p_20906_b;
|
||||
End of 5.0 tests.
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
|
@ -1638,3 +1638,15 @@ Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed
|
||||
call p1();
|
||||
call p1();
|
||||
drop procedure p1;
|
||||
drop procedure if exists proc_8759;
|
||||
create procedure proc_8759()
|
||||
begin
|
||||
declare should_be_illegal condition for sqlstate '00000';
|
||||
declare continue handler for should_be_illegal set @x=0;
|
||||
end$$
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
create procedure proc_8759()
|
||||
begin
|
||||
declare continue handler for sqlstate '00000' set @x=0;
|
||||
end$$
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
|
@ -4155,41 +4155,6 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
|
||||
0
|
||||
0
|
||||
DROP TABLE t1, t2;
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
26
|
||||
25
|
||||
24
|
||||
23
|
||||
22
|
||||
21
|
||||
20
|
||||
19
|
||||
18
|
||||
17
|
||||
16
|
||||
15
|
||||
14
|
||||
13
|
||||
12
|
||||
11
|
||||
10
|
||||
9
|
||||
8
|
||||
7
|
||||
6
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
|
||||
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
|
||||
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
|
||||
|
@ -758,5 +758,16 @@ EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
CREATE TABLE t2 (placeholder CHAR(11));
|
||||
INSERT INTO t2 VALUES("placeholder");
|
||||
SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
|
||||
ROW(1, 2) IN (SELECT t1.a, 2)
|
||||
1
|
||||
SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
|
||||
ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -4,101 +4,36 @@ purge master logs before adddate(current_timestamp(), interval -4 day);
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
sum(a) a
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
ERROR HY000: Thread stack overrun detected
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 index a a 5 NULL 9 Using where; Using index
|
||||
2 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
3 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
4 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
5 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
6 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
7 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
8 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
9 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
10 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
11 SUBQUERY t1 index a b 5 NULL 9 Using where; Using filesort
|
||||
12 SUBQUERY t1 range a a 5 NULL 1 Using where; Using temporary; Using filesort
|
||||
13 SUBQUERY t1 index NULL a 5 NULL 9 Using index
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
ERROR HY000: Thread stack overrun detected
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
26
|
||||
25
|
||||
24
|
||||
23
|
||||
22
|
||||
21
|
||||
20
|
||||
19
|
||||
18
|
||||
17
|
||||
16
|
||||
15
|
||||
14
|
||||
13
|
||||
12
|
||||
11
|
||||
10
|
||||
9
|
||||
8
|
||||
7
|
||||
6
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
@ -3654,6 +3654,24 @@ DROP TABLE t1;
|
||||
|
||||
# -- End of test case for Bug#34337.
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
|
||||
# -- causing syntax error
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
|
||||
|
||||
SELECT * FROM v1;
|
||||
1
|
||||
1
|
||||
SHOW CREATE TABLE v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1 latin1 latin1_swedish_ci
|
||||
|
||||
DROP VIEW v1;
|
||||
|
||||
# -- End of test case for Bug#35193.
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.0 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -4,17 +4,24 @@
|
||||
|
||||
--echo Bug#20023
|
||||
SELECT @@session.sql_big_selects;
|
||||
# The exact value depends on the server build flags
|
||||
--replace_result 4294967295 HA_POS_ERROR 18446744073709551615 HA_POS_ERROR
|
||||
SELECT @@global.max_join_size;
|
||||
--echo change_user
|
||||
--change_user
|
||||
SELECT @@session.sql_big_selects;
|
||||
# The exact value depends on the server build flags
|
||||
--replace_result 4294967295 HA_POS_ERROR 18446744073709551615 HA_POS_ERROR
|
||||
SELECT @@global.max_join_size;
|
||||
SET @@global.max_join_size = 10000;
|
||||
SET @@session.max_join_size = default;
|
||||
--echo change_user
|
||||
--change_user
|
||||
SELECT @@session.sql_big_selects;
|
||||
# May produce a warning depending on server build flags
|
||||
--disable_warnings
|
||||
SET @@global.max_join_size = -1;
|
||||
--enable_warnings
|
||||
SET @@session.max_join_size = default;
|
||||
--echo change_user
|
||||
--change_user
|
||||
|
@ -164,6 +164,15 @@ drop table t1, t2;
|
||||
|
||||
set session low_priority_updates=default;
|
||||
|
||||
#
|
||||
# Bug #33334 mysqltest_embedded crashes when disconnecting before reap
|
||||
#
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
send select benchmark(200, (select sin(1))) > 1000;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@ -923,5 +923,15 @@ DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
SET SQL_MODE=DEFAULT;
|
||||
|
||||
#
|
||||
# Bug #34512: CAST( AVG( double ) AS DECIMAL ) returns wrong results
|
||||
#
|
||||
|
||||
CREATE TABLE t1(a DOUBLE);
|
||||
INSERT INTO t1 VALUES (10), (20);
|
||||
SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
###
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1090,8 +1090,6 @@ select column_default from information_schema.columns where table_name= 't1';
|
||||
show columns from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
# Bug#30079 A check for "hidden" I_S tables is flawed
|
||||
#
|
||||
@ -1099,6 +1097,32 @@ drop table t1;
|
||||
show fields from information_schema.table_names;
|
||||
--error 1109
|
||||
show keys from information_schema.table_names;
|
||||
|
||||
#
|
||||
# Bug#34529: Crash on complex Falcon I_S select after ALTER .. PARTITION BY
|
||||
#
|
||||
USE information_schema;
|
||||
SET max_heap_table_size = 16384;
|
||||
|
||||
CREATE TABLE test.t1( a INT );
|
||||
|
||||
# What we need to create here is a bit of a corner case:
|
||||
# We need a star query with information_schema tables, where the first
|
||||
# branch of the star join produces zero rows, so that reading of the
|
||||
# second branch never happens. At the same time we have to make sure
|
||||
# that data for at least the last table is swapped from MEMORY/HEAP to
|
||||
# MyISAM. This and only this triggers the bug.
|
||||
SELECT *
|
||||
FROM tables ta
|
||||
JOIN collations co ON ( co.collation_name = ta.table_catalog )
|
||||
JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
|
||||
|
||||
DROP TABLE test.t1;
|
||||
SET max_heap_table_size = DEFAULT;
|
||||
USE test;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
# Show engines
|
||||
#
|
||||
|
@ -76,3 +76,16 @@ select referenced_table_schema, referenced_table_name
|
||||
from information_schema.key_column_usage
|
||||
where constraint_schema = 'db-1';
|
||||
drop database `db-1`;
|
||||
|
||||
#
|
||||
# Bug#35108 SELECT FROM REFERENTIAL_CONSTRAINTS crashes
|
||||
#
|
||||
create table t1(id int primary key) engine = Innodb;
|
||||
create table t2(pid int, foreign key (pid) references t1(id)) engine = Innodb;
|
||||
set foreign_key_checks = 0;
|
||||
drop table t1;
|
||||
select UNIQUE_CONSTRAINT_NAME
|
||||
from information_schema.referential_constraints
|
||||
where constraint_schema = schema();
|
||||
drop table t2;
|
||||
set foreign_key_checks = 1;
|
||||
|
@ -598,6 +598,38 @@ show procedure code proc_33618_c;
|
||||
drop procedure proc_33618_h;
|
||||
drop procedure proc_33618_c;
|
||||
|
||||
#
|
||||
# Bug#20906 (Multiple assignments in SET in stored routine produce incorrect
|
||||
# instructions)
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists p_20906_a;
|
||||
drop procedure if exists p_20906_b;
|
||||
--enable_warnings
|
||||
|
||||
create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
|
||||
show procedure code p_20906_a;
|
||||
|
||||
set @a=1;
|
||||
set @b=1;
|
||||
|
||||
call p_20906_a();
|
||||
select @a, @b;
|
||||
|
||||
create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
|
||||
show procedure code p_20906_b;
|
||||
|
||||
set @a=1;
|
||||
set @b=1;
|
||||
set @c=1;
|
||||
|
||||
call p_20906_b();
|
||||
select @a, @b, @c;
|
||||
|
||||
drop procedure p_20906_a;
|
||||
drop procedure p_20906_b;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
@ -2386,6 +2386,32 @@ call p1();
|
||||
call p1();
|
||||
drop procedure p1;
|
||||
|
||||
#
|
||||
# Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop procedure if exists proc_8759;
|
||||
--enable_warnings
|
||||
|
||||
delimiter $$;
|
||||
|
||||
--error ER_SP_BAD_SQLSTATE
|
||||
create procedure proc_8759()
|
||||
begin
|
||||
declare should_be_illegal condition for sqlstate '00000';
|
||||
declare continue handler for should_be_illegal set @x=0;
|
||||
end$$
|
||||
|
||||
--error ER_SP_BAD_SQLSTATE
|
||||
create procedure proc_8759()
|
||||
begin
|
||||
declare continue handler for sqlstate '00000' set @x=0;
|
||||
end$$
|
||||
|
||||
delimiter ;$$
|
||||
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
@ -3015,52 +3015,6 @@ INSERT INTO t2 VALUES (103, 203);
|
||||
SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug31048: Many nested subqueries may cause server crash.
|
||||
#
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
|
||||
let $nesting= 26;
|
||||
let $should_work_nesting= 5;
|
||||
let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ;
|
||||
let $end= )group by a ;
|
||||
let $start_app= where a> ( select sum(a) from t1 ;
|
||||
let $end_pre= )group by b limit 1 ;
|
||||
|
||||
--disable_result_log
|
||||
--disable_query_log
|
||||
# At least 4 level nesting should work without errors
|
||||
while ($should_work_nesting)
|
||||
{
|
||||
--echo $should_work_nesting
|
||||
eval $start $end;
|
||||
eval explain $start $end;
|
||||
let $start= $start
|
||||
$start_app;
|
||||
let $end= $end_pre
|
||||
$end;
|
||||
dec $should_work_nesting;
|
||||
}
|
||||
# Other may fail with the 'stack overrun error'
|
||||
while ($nesting)
|
||||
{
|
||||
--echo $nesting
|
||||
--error 0,1436
|
||||
eval $start $end;
|
||||
--error 0,1436
|
||||
eval explain $start $end;
|
||||
let $start= $start
|
||||
$start_app;
|
||||
let $end= $end_pre
|
||||
$end;
|
||||
dec $nesting;
|
||||
}
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #28076: inconsistent binary/varbinary comparison
|
||||
#
|
||||
|
@ -586,6 +586,23 @@ SELECT a FROM t1 WHERE a NOT IN (65,66);
|
||||
SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
|
||||
EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# Bug #34763: item_subselect.cc:1235:Item_in_subselect::row_value_transformer:
|
||||
# Assertion failed, unexpected error message:
|
||||
# ERROR 1247 (42S22): Reference '<list ref>' not supported (forward
|
||||
# reference in item list)
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
||||
CREATE TABLE t2 (placeholder CHAR(11));
|
||||
INSERT INTO t2 VALUES("placeholder");
|
||||
|
||||
SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
|
||||
SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -14,92 +14,44 @@ purge master logs before adddate(current_timestamp(), interval -4 day);
|
||||
create table t1(a int,b int,key(a),key(b));
|
||||
insert into t1(a,b) values (1,2),(2,1),(2,3),(3,4),(5,4),(5,5),
|
||||
(6,7),(7,4),(5,3);
|
||||
# test for the stack overflow bug
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
--replace_regex /overrun.*$/overrun detected/
|
||||
--error 1436
|
||||
select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
# test for the memory consumption & subquery slowness bug
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
--replace_regex /overrun.*$/overrun detected/
|
||||
--error 1436
|
||||
explain select sum(a),a from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1 where a> ( select sum(a) from t1 where a> (
|
||||
select sum(a) from t1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1
|
||||
)group by b limit 1)group by b limit 1)group by b limit 1)
|
||||
group by a;
|
||||
|
||||
let $nesting= 26;
|
||||
let $should_work_nesting= 5;
|
||||
let $start= select sum(a),a from t1 where a> ( select sum(a) from t1 ;
|
||||
let $end= )group by a ;
|
||||
let $start_app= where a> ( select sum(a) from t1 ;
|
||||
let $end_pre= )group by b limit 1 ;
|
||||
|
||||
--disable_result_log
|
||||
--disable_query_log
|
||||
# At least 4 level nesting should work without errors
|
||||
while ($should_work_nesting)
|
||||
{
|
||||
--echo $should_work_nesting
|
||||
eval $start $end;
|
||||
eval explain $start $end;
|
||||
let $start= $start
|
||||
$start_app;
|
||||
let $end= $end_pre
|
||||
$end;
|
||||
dec $should_work_nesting;
|
||||
}
|
||||
# Other may fail with the 'stack overrun error'
|
||||
while ($nesting)
|
||||
{
|
||||
--echo $nesting
|
||||
--error 0,1436
|
||||
eval $start $end;
|
||||
--error 0,1436
|
||||
eval explain $start $end;
|
||||
let $start= $start
|
||||
$start_app;
|
||||
let $end= $end_pre
|
||||
$end;
|
||||
dec $nesting;
|
||||
}
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
drop table t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -3533,6 +3533,29 @@ DROP TABLE t1;
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
|
||||
--echo # -- causing syntax error
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
|
||||
|
||||
--echo
|
||||
|
||||
SELECT * FROM v1;
|
||||
SHOW CREATE TABLE v1;
|
||||
|
||||
--echo
|
||||
|
||||
DROP VIEW v1;
|
||||
|
||||
--echo
|
||||
--echo # -- End of test case for Bug#35193.
|
||||
--echo
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.0 tests.
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
@ -1883,7 +1883,7 @@ private:
|
||||
{ return HA_ADMIN_NOT_IMPLEMENTED; }
|
||||
virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{ return HA_ADMIN_NOT_IMPLEMENTED; }
|
||||
virtual bool check_and_repair(THD *thd) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual bool check_and_repair(THD *thd) { return TRUE; }
|
||||
virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual int discard_or_import_tablespace(my_bool discard)
|
||||
|
11
sql/item.cc
11
sql/item.cc
@ -5605,13 +5605,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
||||
DBUG_ASSERT(*ref);
|
||||
/*
|
||||
Check if this is an incorrect reference in a group function or forward
|
||||
reference. Do not issue an error if this is an unnamed reference inside an
|
||||
aggregate function.
|
||||
reference. Do not issue an error if this is:
|
||||
1. outer reference (will be fixed later by the fix_inner_refs function);
|
||||
2. an unnamed reference inside an aggregate function.
|
||||
*/
|
||||
if (((*ref)->with_sum_func && name &&
|
||||
if (!((*ref)->type() == REF_ITEM &&
|
||||
((Item_ref *)(*ref))->ref_type() == OUTER_REF) &&
|
||||
(((*ref)->with_sum_func && name &&
|
||||
!(current_sel->linkage != GLOBAL_OPTIONS_TYPE &&
|
||||
current_sel->having_fix_field)) ||
|
||||
!(*ref)->fixed)
|
||||
!(*ref)->fixed))
|
||||
{
|
||||
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
|
||||
name, ((*ref)->with_sum_func?
|
||||
|
@ -1288,7 +1288,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
|
||||
Item *item_having_part2= 0;
|
||||
for (uint i= 0; i < cols_num; i++)
|
||||
{
|
||||
DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed);
|
||||
DBUG_ASSERT(left_expr->fixed &&
|
||||
select_lex->ref_pointer_array[i]->fixed ||
|
||||
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
|
||||
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
||||
Item_ref::OUTER_REF));
|
||||
if (select_lex->ref_pointer_array[i]->
|
||||
check_cols(left_expr->element_index(i)->cols()))
|
||||
DBUG_RETURN(RES_ERROR);
|
||||
@ -1362,7 +1366,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
|
||||
for (uint i= 0; i < cols_num; i++)
|
||||
{
|
||||
Item *item, *item_isnull;
|
||||
DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed);
|
||||
DBUG_ASSERT(left_expr->fixed &&
|
||||
select_lex->ref_pointer_array[i]->fixed ||
|
||||
(select_lex->ref_pointer_array[i]->type() == REF_ITEM &&
|
||||
((Item_ref*)(select_lex->ref_pointer_array[i]))->ref_type() ==
|
||||
Item_ref::OUTER_REF));
|
||||
if (select_lex->ref_pointer_array[i]->
|
||||
check_cols(left_expr->element_index(i)->cols()))
|
||||
DBUG_RETURN(RES_ERROR);
|
||||
|
@ -1228,7 +1228,15 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val)
|
||||
null_value=1;
|
||||
return NULL;
|
||||
}
|
||||
sum_dec= Item_sum_sum::val_decimal(&sum_buff);
|
||||
|
||||
/*
|
||||
For non-DECIMAL hybrid_type the division will be done in
|
||||
Item_sum_avg::val_real().
|
||||
*/
|
||||
if (hybrid_type != DECIMAL_RESULT)
|
||||
return val_decimal_from_real(val);
|
||||
|
||||
sum_dec= dec_buffs + curr_dec_buff;
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, count, 0, &cnt);
|
||||
my_decimal_div(E_DEC_FATAL_ERROR, val, sum_dec, &cnt, prec_increment);
|
||||
return val;
|
||||
|
@ -1006,7 +1006,7 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command,
|
||||
|
||||
current_time= my_time(0);
|
||||
while (*current_handler)
|
||||
error+= (*current_handler++)->
|
||||
error|= (*current_handler++)->
|
||||
log_general(thd, current_time, user_host_buff,
|
||||
user_host_len, id,
|
||||
command_name[(uint) command].str,
|
||||
|
@ -741,8 +741,8 @@ inline bool check_some_routine_access(THD *thd, const char *db,
|
||||
|
||||
bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
|
||||
bool multi_delete_precheck(THD *thd, TABLE_LIST *tables);
|
||||
bool mysql_multi_update_prepare(THD *thd);
|
||||
bool mysql_multi_delete_prepare(THD *thd);
|
||||
int mysql_multi_update_prepare(THD *thd);
|
||||
int mysql_multi_delete_prepare(THD *thd);
|
||||
bool mysql_insert_select_prepare(THD *thd);
|
||||
bool update_precheck(THD *thd, TABLE_LIST *tables);
|
||||
bool delete_precheck(THD *thd, TABLE_LIST *tables);
|
||||
@ -976,7 +976,7 @@ void decrease_user_connections(USER_CONN *uc);
|
||||
void thd_init_client_charset(THD *thd, uint cs_number);
|
||||
bool setup_connection_thread_globals(THD *thd);
|
||||
|
||||
bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
|
||||
int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create, bool silent);
|
||||
bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create);
|
||||
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent);
|
||||
bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db);
|
||||
@ -1020,7 +1020,7 @@ void init_max_user_conn(void);
|
||||
void init_update_queries(void);
|
||||
void free_max_user_conn(void);
|
||||
pthread_handler_t handle_bootstrap(void *arg);
|
||||
bool mysql_execute_command(THD *thd);
|
||||
int mysql_execute_command(THD *thd);
|
||||
bool do_command(THD *thd);
|
||||
bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
char* packet, uint packet_length);
|
||||
@ -1196,7 +1196,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
|
||||
int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
|
||||
TABLE_LIST *table_list);
|
||||
void prepare_triggers_for_insert_stmt(TABLE *table);
|
||||
bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds);
|
||||
int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds);
|
||||
bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
||||
SQL_LIST *order, ha_rows rows, ulonglong options,
|
||||
bool reset_auto_increment);
|
||||
@ -1470,14 +1470,14 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex,
|
||||
pthread_cond_t *cond);
|
||||
int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags);
|
||||
/* open_and_lock_tables with optional derived handling */
|
||||
bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
|
||||
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
|
||||
/* simple open_and_lock_tables without derived handling */
|
||||
inline bool simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
inline int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
return open_and_lock_tables_derived(thd, tables, FALSE);
|
||||
}
|
||||
/* open_and_lock_tables with derived handling */
|
||||
inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
inline int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
return open_and_lock_tables_derived(thd, tables, TRUE);
|
||||
}
|
||||
@ -1707,7 +1707,7 @@ inline TABLE_LIST *find_table_in_local_list(TABLE_LIST *table,
|
||||
bool eval_const_cond(COND *cond);
|
||||
|
||||
/* sql_load.cc */
|
||||
bool mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
|
||||
int mysql_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list,
|
||||
List<Item> &fields_vars, List<Item> &set_fields,
|
||||
List<Item> &set_values_list,
|
||||
enum enum_duplicates handle_duplicates, bool ignore,
|
||||
|
@ -144,7 +144,7 @@ public:
|
||||
virtual int send_row(List<Item> &fields)=0;
|
||||
virtual bool change_columns(List<Item> &fields)=0;
|
||||
virtual void update_refs(void) {}
|
||||
virtual bool end_of_records() { return 0; }
|
||||
virtual int end_of_records() { return 0; }
|
||||
};
|
||||
|
||||
Procedure *setup_procedure(THD *thd,ORDER *proc_param,select_result *result,
|
||||
|
@ -51,6 +51,8 @@ sp_cond_check(LEX_STRING *sqlstate)
|
||||
(c < 'A' || 'Z' < c))
|
||||
return FALSE;
|
||||
}
|
||||
if (strcmp(sqlstate->str, "00000") == 0)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1521,7 +1521,7 @@ bool acl_check_host(const char *host, const char *ip)
|
||||
1 ERROR ; In this case the error is sent to the client.
|
||||
*/
|
||||
|
||||
bool check_change_password(THD *thd, const char *host, const char *user,
|
||||
int check_change_password(THD *thd, const char *host, const char *user,
|
||||
char *new_password, uint new_password_len)
|
||||
{
|
||||
if (!initialized)
|
||||
@ -2923,7 +2923,7 @@ table_error:
|
||||
TRUE error
|
||||
*/
|
||||
|
||||
bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
List <LEX_USER> &user_list,
|
||||
List <LEX_COLUMN> &columns, ulong rights,
|
||||
bool revoke_grant)
|
||||
@ -6148,7 +6148,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
< 0 Error. Error message not yet sent.
|
||||
*/
|
||||
|
||||
bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
bool is_proc)
|
||||
{
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
|
@ -222,13 +222,13 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd,
|
||||
bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
|
||||
char *ip, char *db);
|
||||
bool acl_check_host(const char *host, const char *ip);
|
||||
bool check_change_password(THD *thd, const char *host, const char *user,
|
||||
int check_change_password(THD *thd, const char *host, const char *user,
|
||||
char *password, uint password_len);
|
||||
bool change_password(THD *thd, const char *host, const char *user,
|
||||
char *password);
|
||||
bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
|
||||
ulong rights, bool revoke);
|
||||
bool mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
|
||||
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
|
||||
List <LEX_COLUMN> &column_list, ulong rights,
|
||||
bool revoke);
|
||||
bool mysql_routine_grant(THD *thd, TABLE_LIST *table, bool is_proc,
|
||||
@ -264,7 +264,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
|
||||
const char *db, const char *table);
|
||||
bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
bool is_proc);
|
||||
bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
int sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name,
|
||||
bool is_proc);
|
||||
bool check_routine_level_acl(THD *thd, const char *db, const char *name,
|
||||
bool is_proc);
|
||||
|
@ -682,7 +682,7 @@ int analyse::send_row(List<Item> & /* field_list */)
|
||||
} // analyse::send_row
|
||||
|
||||
|
||||
bool analyse::end_of_records()
|
||||
int analyse::end_of_records()
|
||||
{
|
||||
field_info **f = f_info;
|
||||
char buff[MAX_FIELD_WIDTH];
|
||||
|
@ -350,7 +350,7 @@ public:
|
||||
virtual bool change_columns(List<Item> &fields);
|
||||
virtual int send_row(List<Item> &field_list);
|
||||
virtual void end_group(void) {}
|
||||
virtual bool end_of_records(void);
|
||||
virtual int end_of_records(void);
|
||||
friend Procedure *proc_analyse_init(THD *thd, ORDER *param,
|
||||
select_result *result,
|
||||
List<Item> &field_list);
|
||||
|
@ -4866,7 +4866,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
|
||||
the third argument set appropriately.
|
||||
*/
|
||||
|
||||
bool open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived)
|
||||
int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived)
|
||||
{
|
||||
uint counter;
|
||||
bool need_reopen;
|
||||
|
@ -606,7 +606,7 @@ CHARSET_INFO *get_default_db_collation(THD *thd, const char *db_name)
|
||||
|
||||
*/
|
||||
|
||||
bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
|
||||
int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
|
||||
bool silent)
|
||||
{
|
||||
char path[FN_REFLEN+16];
|
||||
|
@ -419,7 +419,7 @@ cleanup:
|
||||
FALSE OK
|
||||
TRUE error
|
||||
*/
|
||||
bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
|
||||
int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
|
||||
{
|
||||
Item *fake_conds= 0;
|
||||
SELECT_LEX *select_lex= &thd->lex->select_lex;
|
||||
@ -495,7 +495,7 @@ extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b)
|
||||
TRUE Error
|
||||
*/
|
||||
|
||||
bool mysql_multi_delete_prepare(THD *thd)
|
||||
int mysql_multi_delete_prepare(THD *thd)
|
||||
{
|
||||
LEX *lex= thd->lex;
|
||||
TABLE_LIST *aux_tables= (TABLE_LIST *)lex->auxiliary_table_list.first;
|
||||
|
@ -110,7 +110,7 @@ static bool write_execute_load_query_log_event(THD *thd,
|
||||
TRUE - error / FALSE - success
|
||||
*/
|
||||
|
||||
bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
List<Item> &fields_vars, List<Item> &set_fields,
|
||||
List<Item> &set_values,
|
||||
enum enum_duplicates handle_duplicates, bool ignore,
|
||||
|
@ -1856,10 +1856,10 @@ bool sp_process_definer(THD *thd)
|
||||
TRUE Error
|
||||
*/
|
||||
|
||||
bool
|
||||
int
|
||||
mysql_execute_command(THD *thd)
|
||||
{
|
||||
bool res= FALSE;
|
||||
int res= FALSE;
|
||||
bool need_start_waiting= FALSE; // have protection against global read lock
|
||||
int up_result= 0;
|
||||
LEX *lex= thd->lex;
|
||||
|
@ -1415,7 +1415,7 @@ error:
|
||||
*/
|
||||
|
||||
static bool select_like_stmt_test(Prepared_statement *stmt,
|
||||
bool (*specific_prepare)(THD *thd),
|
||||
int (*specific_prepare)(THD *thd),
|
||||
ulong setup_tables_done_option)
|
||||
{
|
||||
DBUG_ENTER("select_like_stmt_test");
|
||||
@ -1452,7 +1452,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt,
|
||||
static bool
|
||||
select_like_stmt_test_with_open(Prepared_statement *stmt,
|
||||
TABLE_LIST *tables,
|
||||
bool (*specific_prepare)(THD *thd),
|
||||
int (*specific_prepare)(THD *thd),
|
||||
ulong setup_tables_done_option)
|
||||
{
|
||||
DBUG_ENTER("select_like_stmt_test_with_open");
|
||||
@ -1638,7 +1638,7 @@ error:
|
||||
uses local tables lists.
|
||||
*/
|
||||
|
||||
static bool mysql_insert_select_prepare_tester(THD *thd)
|
||||
static int mysql_insert_select_prepare_tester(THD *thd)
|
||||
{
|
||||
SELECT_LEX *first_select= &thd->lex->select_lex;
|
||||
TABLE_LIST *second_table= ((TABLE_LIST*)first_select->table_list.first)->
|
||||
|
@ -16502,6 +16502,14 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
|
||||
/* go through join tree */
|
||||
print_join(thd, str, &top_join_list, query_type);
|
||||
}
|
||||
else if (where)
|
||||
{
|
||||
/*
|
||||
"SELECT 1 FROM DUAL WHERE 2" should not be printed as
|
||||
"SELECT 1 WHERE 2": the 1st syntax is valid, but the 2nd is not.
|
||||
*/
|
||||
str->append(STRING_WITH_LEN(" from DUAL "));
|
||||
}
|
||||
|
||||
// Where
|
||||
Item *cur_where= where;
|
||||
|
@ -5277,8 +5277,14 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
|
||||
f_key_info->referenced_db->length, cs);
|
||||
table->field[10]->store(f_key_info->referenced_table->str,
|
||||
f_key_info->referenced_table->length, cs);
|
||||
if (f_key_info->referenced_key_name)
|
||||
{
|
||||
table->field[5]->store(f_key_info->referenced_key_name->str,
|
||||
f_key_info->referenced_key_name->length, cs);
|
||||
table->field[5]->set_notnull();
|
||||
}
|
||||
else
|
||||
table->field[5]->set_null();
|
||||
table->field[6]->store(STRING_WITH_LEN("NONE"), cs);
|
||||
table->field[7]->store(f_key_info->update_method->str,
|
||||
f_key_info->update_method->length, cs);
|
||||
@ -5883,9 +5889,11 @@ bool get_schema_tables_result(JOIN *join,
|
||||
{
|
||||
result= 1;
|
||||
join->error= 1;
|
||||
tab->read_record.file= table_list->table->file;
|
||||
table_list->schema_table_state= executed_place;
|
||||
break;
|
||||
}
|
||||
tab->read_record.file= table_list->table->file;
|
||||
table_list->schema_table_state= executed_place;
|
||||
}
|
||||
}
|
||||
@ -6481,8 +6489,8 @@ ST_FIELD_INFO referential_constraints_fields_info[]=
|
||||
OPEN_FULL_TABLE},
|
||||
{"UNIQUE_CONSTRAINT_SCHEMA", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"UNIQUE_CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0,
|
||||
OPEN_FULL_TABLE},
|
||||
{"UNIQUE_CONSTRAINT_NAME", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0,
|
||||
MY_I_S_MAYBE_NULL, 0, OPEN_FULL_TABLE},
|
||||
{"MATCH_OPTION", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"UPDATE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
{"DELETE_RULE", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, 0, OPEN_FULL_TABLE},
|
||||
|
@ -42,7 +42,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
|
||||
static bool prepare_blob_field(THD *thd, Create_field *sql_field);
|
||||
static bool check_engine(THD *, const char *, HA_CREATE_INFO *);
|
||||
static bool
|
||||
static int
|
||||
mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
Alter_info *alter_info,
|
||||
bool tmp_table,
|
||||
@ -2177,7 +2177,7 @@ int prepare_create_field(Create_field *sql_field,
|
||||
TRUE error
|
||||
*/
|
||||
|
||||
static bool
|
||||
static int
|
||||
mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
Alter_info *alter_info,
|
||||
bool tmp_table,
|
||||
|
@ -943,7 +943,7 @@ static table_map get_table_map(List<Item> *items)
|
||||
TRUE Error
|
||||
*/
|
||||
|
||||
bool mysql_multi_update_prepare(THD *thd)
|
||||
int mysql_multi_update_prepare(THD *thd)
|
||||
{
|
||||
LEX *lex= thd->lex;
|
||||
TABLE_LIST *table_list= lex->query_tables;
|
||||
|
@ -6226,6 +6226,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
|
||||
foreign->referenced_index->name,
|
||||
strlen(foreign->referenced_index->name), 1);
|
||||
}
|
||||
else
|
||||
f_key_info.referenced_key_name= 0;
|
||||
|
||||
FOREIGN_KEY_INFO *pf_key_info = (FOREIGN_KEY_INFO *)
|
||||
thd_memdup(thd, &f_key_info, sizeof(FOREIGN_KEY_INFO));
|
||||
|
Loading…
x
Reference in New Issue
Block a user