mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Merge host.loc:/home/uchum/work/mysql-5.0
into host.loc:/home/uchum/work/5.0-opt sql/sql_delete.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_update.cc: Auto merged
This commit is contained in:
commit
11cfd2ed67
35 changed files with 291 additions and 55 deletions
|
@ -78,6 +78,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")
|
||||
|
|
|
@ -550,6 +550,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)
|
||||
|
@ -4071,7 +4082,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;
|
||||
|
@ -4361,6 +4379,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)
|
||||
|
@ -5848,16 +5869,11 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
}
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
/*
|
||||
Here we handle 'reap' command, so we need to check if the
|
||||
query's thread was finished and probably wait
|
||||
Here we handle 'reap' command, so we need to check if the
|
||||
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;
|
||||
|
|
|
@ -157,14 +157,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 */
|
||||
|
@ -457,4 +455,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
|
||||
|
|
|
@ -980,7 +980,7 @@ typedef int myf; /* Type of MyFlags in my_funcs */
|
|||
typedef char byte; /* Smallest addressable unit */
|
||||
#endif
|
||||
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 */
|
||||
|
|
|
@ -72,3 +72,4 @@ flush tables with read lock;
|
|||
unlock tables;
|
||||
drop table t1, t2;
|
||||
set session low_priority_updates=default;
|
||||
select benchmark(200, (select sin(1))) > 1000;
|
||||
|
|
|
@ -1419,4 +1419,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
|
||||
|
|
|
@ -1417,8 +1417,19 @@ select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
|
|||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
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.
|
||||
|
|
|
@ -842,4 +842,32 @@ 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 32 "SET @a=@a+1"
|
||||
1 stmt 32 "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 32 "SET @a=@a+1"
|
||||
1 stmt 32 "SET @b=@b+1"
|
||||
2 stmt 32 "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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3659,6 +3659,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
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1
|
||||
|
||||
DROP VIEW v1;
|
||||
|
||||
# -- End of test case for Bug#35193.
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.0 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
|
|
@ -164,4 +164,13 @@ 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;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
|
|
@ -916,5 +916,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
|
||||
|
|
|
@ -1108,8 +1108,6 @@ select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL;
|
|||
select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
|
||||
select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
# Bug#30079 A check for "hidden" I_S tables is flawed
|
||||
#
|
||||
|
@ -1118,3 +1116,28 @@ 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.
|
||||
|
||||
|
|
|
@ -598,4 +598,36 @@ 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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3537,6 +3537,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 # -----------------------------------------------------------------
|
||||
|
|
|
@ -815,7 +815,7 @@ public:
|
|||
{ return HA_ADMIN_NOT_IMPLEMENTED; }
|
||||
/* end of the list of admin commands */
|
||||
|
||||
virtual bool check_and_repair(THD *thd) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual bool check_and_repair(THD *thd) { return TRUE; }
|
||||
virtual int dump(THD* thd, int fd = -1) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
|
||||
virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
|
||||
|
|
15
sql/item.cc
15
sql/item.cc
|
@ -5481,13 +5481,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 &&
|
||||
!(current_sel->linkage != GLOBAL_OPTIONS_TYPE &&
|
||||
current_sel->having_fix_field)) ||
|
||||
!(*ref)->fixed)
|
||||
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))
|
||||
{
|
||||
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
|
||||
name, ((*ref)->with_sum_func?
|
||||
|
|
|
@ -1232,7 +1232,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);
|
||||
|
@ -1306,7 +1310,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);
|
||||
|
|
|
@ -1206,7 +1206,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;
|
||||
|
|
|
@ -597,8 +597,8 @@ bool check_merge_table_access(THD *thd, char *db,
|
|||
bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc);
|
||||
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);
|
||||
|
@ -691,7 +691,7 @@ struct Query_cache_query_flags
|
|||
|
||||
uint build_table_path(char *buff, size_t bufflen, const char *db,
|
||||
const char *table, const char *ext);
|
||||
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);
|
||||
void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ushort flags);
|
||||
|
@ -731,7 +731,7 @@ pthread_handler_t handle_one_connection(void *arg);
|
|||
pthread_handler_t handle_bootstrap(void *arg);
|
||||
void end_thread(THD *thd,bool put_in_cache);
|
||||
void flush_thread_cache();
|
||||
bool mysql_execute_command(THD *thd);
|
||||
int mysql_execute_command(THD *thd);
|
||||
bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
char* packet, uint packet_length);
|
||||
void log_slow_statement(THD *thd);
|
||||
|
@ -862,7 +862,7 @@ void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table,
|
|||
enum_duplicates duplic);
|
||||
void mark_fields_used_by_triggers_for_insert_stmt(THD *thd, TABLE *table,
|
||||
enum_duplicates duplic);
|
||||
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);
|
||||
|
@ -1106,7 +1106,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX* select, bool no_order);
|
|||
void wait_for_refresh(THD *thd);
|
||||
int open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags);
|
||||
int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables);
|
||||
bool open_and_lock_tables(THD *thd,TABLE_LIST *tables);
|
||||
int open_and_lock_tables(THD *thd,TABLE_LIST *tables);
|
||||
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
|
||||
int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen);
|
||||
TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
|
||||
|
@ -1177,7 +1177,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,
|
||||
|
|
|
@ -1382,7 +1382,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)
|
||||
|
@ -2763,7 +2763,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)
|
||||
|
@ -5805,7 +5805,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;
|
||||
|
|
|
@ -183,13 +183,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,
|
||||
|
@ -225,7 +225,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);
|
||||
|
|
|
@ -683,7 +683,7 @@ int analyse::send_row(List<Item> &field_list __attribute__((unused)))
|
|||
} // 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> &fields);
|
||||
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);
|
||||
|
|
|
@ -3046,7 +3046,7 @@ int simple_open_n_lock_tables(THD *thd, TABLE_LIST *tables)
|
|||
The lock will automaticaly be freed by close_thread_tables()
|
||||
*/
|
||||
|
||||
bool open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
{
|
||||
uint counter;
|
||||
bool need_reopen;
|
||||
|
|
|
@ -449,7 +449,7 @@ bool load_db_opt_by_name(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];
|
||||
|
|
|
@ -375,7 +375,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;
|
||||
|
@ -438,7 +438,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,
|
||||
|
|
|
@ -2500,10 +2500,10 @@ static void reset_one_shot_variables(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;
|
||||
|
|
|
@ -1403,7 +1403,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");
|
||||
|
@ -1441,7 +1441,7 @@ static bool select_like_stmt_test(Prepared_statement *stmt,
|
|||
static bool
|
||||
select_like_stmt_test_with_open_n_lock(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_n_lock");
|
||||
|
@ -1630,7 +1630,7 @@ error:
|
|||
because mysql_handle_derived 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)->
|
||||
|
|
|
@ -15806,6 +15806,14 @@ void st_select_lex::print(THD *thd, String *str)
|
|||
/* go through join tree */
|
||||
print_join(thd, str, &top_join_list);
|
||||
}
|
||||
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;
|
||||
|
|
|
@ -4073,9 +4073,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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -716,7 +716,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;
|
||||
|
|
Loading…
Reference in a new issue