Commit 3c080754 authored by Tatiana A. Nurnberg's avatar Tatiana A. Nurnberg

auto-merge

parents 406f018d 46a4685c
......@@ -4110,7 +4110,7 @@ static my_bool dump_all_views_in_db(char *database)
for (numrows= 0 ; (table= getTableName(1)); )
{
char *end= strmov(afterdot, table);
if (include_table((uchar*) hash_key,end - hash_key))
if (include_table(hash_key,end - hash_key))
{
numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
......@@ -4131,7 +4131,7 @@ static my_bool dump_all_views_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
if (include_table((uchar*) hash_key, end - hash_key))
if (include_table(hash_key, end - hash_key))
get_view_structure(table, database);
}
if (opt_xml)
......
......@@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type)
{
unsigned char ic = keyseq[i];
if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
if (META_BYTE (ic) && _rl_convert_meta_chars_to_ascii)
{
if (map[ESC].type == ISKMAP)
{
......
......@@ -59,7 +59,8 @@
#define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
#define META_BYTE(c) ((c) > meta_character_threshold)
#define META_CHAR(c) (META_BYTE(c) && (c) <= largest_char)
#define CTRL(c) ((c) & control_character_mask)
#define META(c) ((c) | meta_character_bit)
......
......@@ -1888,7 +1888,7 @@ rl_character_len (c, pos)
uc = (unsigned char)c;
if (META_CHAR (uc))
if (META_BYTE (uc))
return ((_rl_output_meta_chars == 0) ? 4 : 1);
if (uc == '\t')
......
......@@ -32,6 +32,7 @@
.\" === Set line length
.\".ll 6.5i
.TL
.warn 0
D B U G
.P 0
C Program Debugging Package
......
......@@ -511,7 +511,7 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->write_pos + (Count) <=(info)->write_end ?\
(memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
((info)->write_pos+=(Count)),0) : \
(*(info)->write_function)((info),(Buffer),(Count)))
(*(info)->write_function)((info),(uchar *)(Buffer),(Count)))
#define my_b_get(info) \
((info)->read_pos != (info)->read_end ?\
......
......@@ -25,6 +25,7 @@ test_SCRIPTS = mtr \
mysql-stress-test.pl
nobase_test_DATA = \
valgrind.supp \
lib/v1/mysql-test-run.pl \
lib/v1/mtr_cases.pl \
lib/v1/mtr_io.pl \
......@@ -41,7 +42,6 @@ nobase_test_DATA = \
lib/v1/mtr_im.pl \
lib/v1/mtr_process.pl \
lib/v1/mtr_unique.pl \
\
lib/mtr_cases.pm \
lib/mtr_gcov.pl \
lib/mtr_gprof.pl \
......@@ -69,9 +69,8 @@ nobase_test_DATA = \
SUBDIRS = lib/My/SafeProcess
EXTRA_DIST = README \
valgrind.supp \
$(test_SCRIPTS) \
$(nobase_test_DATA)
$(nobase_test_DATA)
# List of directories containing test + result files and the
# related test data files that should be copied
......@@ -93,7 +92,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/jp suite/jp/t suite/jp/r suite/jp/std_data suite/jp/include \
suite/manual/t suite/manual/r \
suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
suite/rpl suite/rpl/data suite/rpl/include suite/rpl/r \
suite/rpl suite/rpl/include suite/rpl/r \
suite/rpl/t \
suite/stress/include suite/stress/t suite/stress/r \
suite/ndb suite/ndb/t suite/ndb/r \
......
......@@ -1171,6 +1171,16 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY COMMENT 'My ID#', f2 INTEGER DEFAULT NUL
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # Bug #36995: valgrind error in remove_const during subquery executions
--echo #
create table t1 (a bit(1) not null,b int) engine=myisam;
create table t2 (c int) engine=innodb;
explain
select b from t1 where a not in (select b from t1,t2 group by a) group by a;
DROP TABLE t1,t2;
--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
......
......@@ -40,6 +40,14 @@ abcd abcd
efgh efgh
ijkl ijkl
DROP TABLE t1;
#
# Bug#43827 Server closes connections and restarts
#
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
INSERT INTO t1 SELECT REPEAT('a',11);
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
DROP TABLE t1;
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
ucs2_vn_ci ucs2 242 8
......
......@@ -1420,6 +1420,18 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `f2_ref` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Bug #36995: valgrind error in remove_const during subquery executions
#
create table t1 (a bit(1) not null,b int) engine=myisam;
create table t2 (c int) engine=innodb;
explain
select b from t1 where a not in (select b from t1,t2 group by a) group by a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 0 const row not found
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1
DROP TABLE t1,t2;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,
......
drop table if exists t3;
create table t3 ( f bigint unsigned not null );
drop procedure if exists fib;
create procedure fib(n int unsigned)
begin
if n > 1 then
begin
declare x, y bigint unsigned;
declare c cursor for select f from t3 order by f desc limit 2;
open c;
fetch c into y;
fetch c into x;
close c;
insert into t3 values (x+y);
call fib(n-1);
end;
end if;
end|
set @@max_sp_recursion_depth= 20|
insert into t3 values (0), (1)|
call fib(3)|
select * from t3 order by f asc|
f
0
1
1
2
truncate table t3|
insert into t3 values (0), (1)|
call fib(10)|
select * from t3 order by f asc|
f
0
1
1
2
3
5
8
13
21
34
55
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
......@@ -1337,52 +1337,6 @@ drop procedure opp|
drop procedure ip|
show procedure status where name like '%p%' and db='test'|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
drop table if exists t3|
create table t3 ( f bigint unsigned not null )|
drop procedure if exists fib|
create procedure fib(n int unsigned)
begin
if n > 1 then
begin
declare x, y bigint unsigned;
declare c cursor for select f from t3 order by f desc limit 2;
open c;
fetch c into y;
fetch c into x;
close c;
insert into t3 values (x+y);
call fib(n-1);
end;
end if;
end|
set @@max_sp_recursion_depth= 20|
insert into t3 values (0), (1)|
call fib(3)|
select * from t3 order by f asc|
f
0
1
1
2
truncate table t3|
insert into t3 values (0), (1)|
call fib(10)|
select * from t3 order by f asc|
f
0
1
1
2
3
5
8
13
21
34
55
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
drop procedure if exists bar|
create procedure bar(x char(16), y int)
comment "111111111111" sql security invoker
......
......@@ -37,6 +37,15 @@ UPDATE t1 SET col2=col1;
SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
DROP TABLE t1;
--echo #
--echo # Bug#43827 Server closes connections and restarts
--echo #
# Crash happened with a user-defined utf8 collation,
# on attempt to insert a string longer than the column can store.
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
INSERT INTO t1 SELECT REPEAT('a',11);
DROP TABLE t1;
#
# Vietnamese experimental collation
#
......
# Fibonacci, for recursion test. (Yet Another Numerical series :)
# Split from main.sp due to problems reported in Bug#15866
--disable_warnings
drop table if exists t3;
--enable_warnings
create table t3 ( f bigint unsigned not null );
# We deliberately do it the awkward way, fetching the last two
# values from the table, in order to exercise various statements
# and table accesses at each turn.
--disable_warnings
drop procedure if exists fib;
--enable_warnings
# Now for multiple statements...
delimiter |;
create procedure fib(n int unsigned)
begin
if n > 1 then
begin
declare x, y bigint unsigned;
declare c cursor for select f from t3 order by f desc limit 2;
open c;
fetch c into y;
fetch c into x;
close c;
insert into t3 values (x+y);
call fib(n-1);
end;
end if;
end|
# Enable recursion
set @@max_sp_recursion_depth= 20|
# Minimum test: recursion of 3 levels
insert into t3 values (0), (1)|
call fib(3)|
select * from t3 order by f asc|
truncate table t3|
# The original test, 20 levels, ran into memory limits on some machines
# and builds. Try 10 instead...
insert into t3 values (0), (1)|
call fib(10)|
select * from t3 order by f asc|
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
......@@ -1561,61 +1561,6 @@ drop procedure ip|
show procedure status where name like '%p%' and db='test'|
# Fibonacci, for recursion test. (Yet Another Numerical series :)
#
--disable_warnings
drop table if exists t3|
--enable_warnings
create table t3 ( f bigint unsigned not null )|
# We deliberately do it the awkward way, fetching the last two
# values from the table, in order to exercise various statements
# and table accesses at each turn.
--disable_warnings
drop procedure if exists fib|
--enable_warnings
create procedure fib(n int unsigned)
begin
if n > 1 then
begin
declare x, y bigint unsigned;
declare c cursor for select f from t3 order by f desc limit 2;
open c;
fetch c into y;
fetch c into x;
close c;
insert into t3 values (x+y);
call fib(n-1);
end;
end if;
end|
# Enable recursion
set @@max_sp_recursion_depth= 20|
# Minimum test: recursion of 3 levels
insert into t3 values (0), (1)|
call fib(3)|
select * from t3 order by f asc|
truncate table t3|
# The original test, 20 levels, ran into memory limits on some machines
# and builds. Try 10 instead...
insert into t3 values (0), (1)|
call fib(10)|
select * from t3 order by f asc|
drop table t3|
drop procedure fib|
set @@max_sp_recursion_depth= 0|
#
# Comment & suid
#
......
......@@ -417,6 +417,7 @@ Item::Item(THD *thd, Item *item):
name(item->name),
orig_name(item->orig_name),
max_length(item->max_length),
name_length(item->name_length),
marker(item->marker),
decimals(item->decimals),
maybe_null(item->maybe_null),
......@@ -424,7 +425,9 @@ Item::Item(THD *thd, Item *item):
unsigned_flag(item->unsigned_flag),
with_sum_func(item->with_sum_func),
fixed(item->fixed),
is_autogenerated_name(item->is_autogenerated_name),
collation(item->collation),
with_subselect(item->with_subselect),
cmp_context(item->cmp_context)
{
next= thd->free_list; // Put in free list
......
......@@ -1413,14 +1413,14 @@ enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table);
/* sql_prepare.cc */
void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length);
void mysql_stmt_execute(THD *thd, char *packet, uint packet_length);
void mysql_stmt_close(THD *thd, char *packet);
void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length);
void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_close(THD *thd, char *packet);
void mysql_sql_stmt_prepare(THD *thd);
void mysql_sql_stmt_execute(THD *thd);
void mysql_sql_stmt_close(THD *thd);
void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length);
void mysql_stmt_reset(THD *thd, char *packet);
void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length);
void mysqld_stmt_reset(THD *thd, char *packet);
void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length);
void reinit_stmt_before_use(THD *thd, LEX *lex);
......
......@@ -1165,12 +1165,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_STMT_EXECUTE:
{
mysql_stmt_execute(thd, packet, packet_length);
mysqld_stmt_execute(thd, packet, packet_length);
break;
}
case COM_STMT_FETCH:
{
mysql_stmt_fetch(thd, packet, packet_length);
mysqld_stmt_fetch(thd, packet, packet_length);
break;
}
case COM_STMT_SEND_LONG_DATA:
......@@ -1180,17 +1180,17 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_STMT_PREPARE:
{
mysql_stmt_prepare(thd, packet, packet_length);
mysqld_stmt_prepare(thd, packet, packet_length);
break;
}
case COM_STMT_CLOSE:
{
mysql_stmt_close(thd, packet);
mysqld_stmt_close(thd, packet);
break;
}
case COM_STMT_RESET:
{
mysql_stmt_reset(thd, packet);
mysqld_stmt_reset(thd, packet);
break;
}
case COM_QUERY:
......@@ -5739,7 +5739,7 @@ mysql_new_select(LEX *lex, bool move_down)
/*
Don't evaluate this subquery during statement prepare even if
it's a constant one. The flag is switched off in the end of
mysql_stmt_prepare.
mysqld_stmt_prepare.
*/
if (thd->stmt_arena->is_stmt_prepare())
select_lex->uncacheable|= UNCACHEABLE_PREPARE;
......
......@@ -716,9 +716,9 @@ static void setup_one_conversion_function(THD *thd, Item_param *param,
prepared statement, parameter markers are replaced with variable names.
Example:
@verbatim
mysql_stmt_prepare("UPDATE t1 SET a=a*1.25 WHERE a=?")
mysqld_stmt_prepare("UPDATE t1 SET a=a*1.25 WHERE a=?")
--> general logs gets [Prepare] UPDATE t1 SET a*1.25 WHERE a=?"
mysql_stmt_execute(stmt);
mysqld_stmt_execute(stmt);
--> general and binary logs get
[Execute] UPDATE t1 SET a*1.25 WHERE a=1"
@endverbatim
......@@ -2056,11 +2056,11 @@ static bool init_param_array(Prepared_statement *stmt)
to the client, otherwise an error message is set in THD.
*/
void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length)
{
Prepared_statement *stmt;
bool error;
DBUG_ENTER("mysql_stmt_prepare");
DBUG_ENTER("mysqld_stmt_prepare");
DBUG_PRINT("prep_query", ("%s", packet));
......@@ -2423,7 +2423,7 @@ static void reset_stmt_params(Prepared_statement *stmt)
client, otherwise an error message is set in THD.
*/
void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
{
uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround
ulong stmt_id= uint4korr(packet);
......@@ -2433,7 +2433,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
uchar *packet_end= packet + packet_length;
Prepared_statement *stmt;
bool open_cursor;
DBUG_ENTER("mysql_stmt_execute");
DBUG_ENTER("mysqld_stmt_execute");
packet+= 9; /* stmt_id + 5 bytes of flags */
......@@ -2444,7 +2444,7 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
{
char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_execute");
llstr(stmt_id, llbuf), "mysqld_stmt_execute");
DBUG_VOID_RETURN;
}
......@@ -2525,7 +2525,7 @@ void mysql_sql_stmt_execute(THD *thd)
@param packet_length Length of packet
*/
void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length)
{
/* assume there is always place for 8-16 bytes */
ulong stmt_id= uint4korr(packet);
......@@ -2533,7 +2533,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
Prepared_statement *stmt;
Statement stmt_backup;
Server_side_cursor *cursor;
DBUG_ENTER("mysql_stmt_fetch");
DBUG_ENTER("mysqld_stmt_fetch");
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
......@@ -2542,7 +2542,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
{
char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_fetch");
llstr(stmt_id, llbuf), "mysqld_stmt_fetch");
DBUG_VOID_RETURN;
}
......@@ -2583,9 +2583,9 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
This function resets statement to the state it was right after prepare.
It can be used to:
- clear an error happened during mysql_stmt_send_long_data
- clear an error happened during mysqld_stmt_send_long_data
- cancel long data stream for all placeholders without
having to call mysql_stmt_execute.
having to call mysqld_stmt_execute.
- close an open cursor
Sends 'OK' packet in case of success (statement was reset)
or 'ERROR' packet (unrecoverable error/statement not found/etc).
......@@ -2594,12 +2594,12 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
@param packet Packet with stmt id
*/
void mysql_stmt_reset(THD *thd, char *packet)
void mysqld_stmt_reset(THD *thd, char *packet)
{
/* There is always space for 4 bytes in buffer */
ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_reset");
DBUG_ENTER("mysqld_stmt_reset");
/* First of all clear possible warnings from the previous command */
mysql_reset_thd_for_next_command(thd);
......@@ -2609,7 +2609,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
{
char llbuf[22];
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
llstr(stmt_id, llbuf), "mysql_stmt_reset");
llstr(stmt_id, llbuf), "mysqld_stmt_reset");
DBUG_VOID_RETURN;
}
......@@ -2617,7 +2617,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
/*
Clear parameters from data which could be set by
mysql_stmt_send_long_data() call.
mysqld_stmt_send_long_data() call.
*/
reset_stmt_params(stmt);
......@@ -2638,12 +2638,12 @@ void mysql_stmt_reset(THD *thd, char *packet)
we don't send any reply to this command.
*/
void mysql_stmt_close(THD *thd, char *packet)
void mysqld_stmt_close(THD *thd, char *packet)
{
/* There is always space for 4 bytes in packet buffer */
ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_close");
DBUG_ENTER("mysqld_stmt_close");
thd->main_da.disable_status();
......@@ -2742,7 +2742,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
stmt->state= Query_arena::ERROR;
stmt->last_errno= ER_WRONG_ARGUMENTS;
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS),
"mysql_stmt_send_long_data");
"mysqld_stmt_send_long_data");
DBUG_VOID_RETURN;
}
#endif
......@@ -3166,7 +3166,7 @@ Prepared_statement::set_parameters(String *expanded_query,
if (res)
{
my_error(ER_WRONG_ARGUMENTS, MYF(0),
is_sql_ps ? "EXECUTE" : "mysql_stmt_execute");
is_sql_ps ? "EXECUTE" : "mysqld_stmt_execute");
reset_stmt_params(this);
}
return res;
......@@ -3621,11 +3621,11 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
}
/** Common part of DEALLOCATE PREPARE and mysql_stmt_close. */
/** Common part of DEALLOCATE PREPARE and mysqld_stmt_close. */
void Prepared_statement::deallocate()
{
/* We account deallocate in the same manner as mysql_stmt_close */
/* We account deallocate in the same manner as mysqld_stmt_close */
status_var_increment(thd->status_var.com_stmt_close);
/* Statement map calls delete stmt on erase */
thd->stmt_map.erase(this);
......
......@@ -46,7 +46,7 @@ int myrg_create(const char *name, const char **table_names,
fn_same(buff,name,4);
*(end=strend(buff))='\n';
end[1]=0;
if (my_write(file,(char*) buff,(uint) (end-buff+1),
if (my_write(file,(uchar*) buff,(uint) (end-buff+1),
MYF(MY_WME | MY_NABP)))
goto err;
}
......
......@@ -7992,6 +7992,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t))
static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
cs->pad_char= ' ';
cs->ctype= my_charset_utf8_unicode_ci.ctype;
return create_tailoring(cs, alloc);
}
......
......@@ -328,7 +328,10 @@ my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong length)
{
my_wc_t wc;
int chlen;
for (; (chlen= cs->cset->mb_wc(cs, &wc, str, strend)) > 0; str+= chlen)
for (; (chlen= cs->cset->mb_wc(cs, &wc,
(const unsigned char *) str,
(const unsigned char *) strend)) > 0;
str+= chlen)
{
if (wc > 0x7F)
return MY_REPERTOIRE_UNICODE30;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment