Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-11-29 11:44:37+03:00, kostja@stripped +16 -0
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
MERGE: 1.2356.1.17
BitKeeper/etc/collapsed@stripped, 2006-11-29 11:42:43+03:00, kostja@stripped +2 -4
MERGE: 1.16.1.3
libmysql/libmysql.c@stripped, 2006-11-29 11:42:06+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.258.1.2
mysql-test/r/ps.result@stripped, 2006-11-29 11:42:06+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.87.1.1
mysql-test/t/func_str.test@stripped, 2006-11-29 11:42:06+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.95.1.1
mysql-test/t/ps.test@stripped, 2006-11-29 11:42:06+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.86.1.1
server-tools/instance-manager/mysql_connection.cc@stripped, 2006-11-29 11:43:44+03:00,
kostja@stripped +15 -12
Rollback Monty's removals of explicit casts
MERGE: 1.18.1.2
sql/item_cmpfunc.cc@stripped, 2006-11-29 11:42:10+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.226.1.2
sql/item_func.cc@stripped, 2006-11-29 11:42:10+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.329.1.1
sql/item_strfunc.cc@stripped, 2006-11-29 11:42:11+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.296.1.1
sql/item_sum.cc@stripped, 2006-11-29 11:42:11+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.196.1.1
sql/mysqld.cc@stripped, 2006-11-29 11:42:12+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.589.1.2
sql/set_var.cc@stripped, 2006-11-29 11:42:12+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.200.1.1
sql/sql_lex.cc@stripped, 2006-11-29 11:42:12+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.207.1.2
sql/sql_lex.h@stripped, 2006-11-29 11:42:12+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.245.1.7
sql/sql_yacc.yy@stripped, 2006-11-29 11:42:13+03:00, kostja@stripped +0 -0
Auto merged
MERGE: 1.514.1.1
tests/mysql_client_test.c@stripped, 2006-11-29 11:44:31+03:00, kostja@stripped +0 -0
SCCS merged
MERGE: 1.217.1.13
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kostja
# Host: bodhi.local
# Root: /opt/local/work/mysql-5.1-runtime-merge/RESYNC
--- 1.259/libmysql/libmysql.c 2006-11-29 11:44:49 +03:00
+++ 1.260/libmysql/libmysql.c 2006-11-29 11:44:49 +03:00
@@ -176,16 +176,15 @@ void STDCALL mysql_server_end()
end_embedded_server();
#endif
/* If library called my_init(), free memory allocated by it */
+ finish_client_errs();
if (!org_my_init_done)
{
my_end(MY_DONT_FREE_DBUG);
- /* Remove TRACING, if enabled by mysql_debug() */
+ /* Remove TRACING, if enabled by mysql_debug() */
DBUG_POP();
}
else
mysql_thread_end();
- finish_client_errs();
- free_charsets();
vio_end();
mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER
@@ -2094,7 +2093,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, con
}
stmt->bind= stmt->params + stmt->param_count;
stmt->state= MYSQL_STMT_PREPARE_DONE;
- DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count));
+ DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count));
DBUG_RETURN(0);
}
@@ -2437,10 +2436,10 @@ static my_bool store_param(MYSQL_STMT *s
{
NET *net= &stmt->mysql->net;
DBUG_ENTER("store_param");
- DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d",
+ DBUG_PRINT("enter",("type: %d buffer: 0x%lx length: %lu is_null: %d",
param->buffer_type,
- param->buffer ? param->buffer : "0", *param->length,
- *param->is_null));
+ (long) (param->buffer ? param->buffer : NullS),
+ *param->length, *param->is_null));
if (*param->is_null)
store_param_null(net, param);
@@ -3323,8 +3322,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *st
MYSQL_BIND *param;
DBUG_ENTER("mysql_stmt_send_long_data");
DBUG_ASSERT(stmt != 0);
- DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
- param_number, data, length));
+ DBUG_PRINT("enter",("param no: %d data: 0x%lx, length : %ld",
+ param_number, (long) data, length));
/*
We only need to check for stmt->param_count, if it's not null
@@ -4407,7 +4406,7 @@ my_bool STDCALL mysql_stmt_bind_result(M
ulong bind_count= stmt->field_count;
uint param_count= 0;
DBUG_ENTER("mysql_stmt_bind_result");
- DBUG_PRINT("enter",("field_count: %d", bind_count));
+ DBUG_PRINT("enter",("field_count: %lu", bind_count));
if (!bind_count)
{
--- 1.227/sql/item_cmpfunc.cc 2006-11-29 11:44:49 +03:00
+++ 1.228/sql/item_cmpfunc.cc 2006-11-29 11:44:49 +03:00
@@ -2229,7 +2229,7 @@ cmp_item* cmp_item_row::make_same()
cmp_item_row::~cmp_item_row()
{
DBUG_ENTER("~cmp_item_row");
- DBUG_PRINT("enter",("this: 0x%lx", this));
+ DBUG_PRINT("enter",("this: 0x%lx", (long) this));
if (comparators)
{
for (uint i= 0; i < n; i++)
@@ -3060,7 +3060,7 @@ longlong Item_is_not_null_test::val_int(
if (!used_tables_cache)
{
owner->was_null|= (!cached_value);
- DBUG_PRINT("info", ("cached :%d", cached_value));
+ DBUG_PRINT("info", ("cached: %ld", (long) cached_value));
DBUG_RETURN(cached_value);
}
if (args[0]->is_null())
--- 1.332/sql/item_func.cc 2006-11-29 11:44:49 +03:00
+++ 1.333/sql/item_func.cc 2006-11-29 11:44:49 +03:00
@@ -5051,7 +5051,7 @@ Item_func_sp::result_type() const
{
Field *field;
DBUG_ENTER("Item_func_sp::result_type");
- DBUG_PRINT("info", ("m_sp = %p", m_sp));
+ DBUG_PRINT("info", ("m_sp: 0x%lx", (long) m_sp));
if (result_field)
DBUG_RETURN(result_field->result_type());
--- 1.298/sql/item_strfunc.cc 2006-11-29 11:44:49 +03:00
+++ 1.299/sql/item_strfunc.cc 2006-11-29 11:44:49 +03:00
@@ -992,8 +992,8 @@ String *Item_func_insert::val_str(String
if (length > res->length() - start)
length= res->length() - start;
- if (res->length() - length + res2->length() >
- current_thd->variables.max_allowed_packet)
+ if ((ulonglong) (res->length() - length + res2->length()) >
+ (ulonglong) current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
@@ -2485,7 +2485,7 @@ String *Item_func_lpad::val_str(String *
pad_char_length= pad->numchars();
byte_count= count * collation.collation->mbmaxlen;
- if (byte_count > current_thd->variables.max_allowed_packet)
+ if ((ulonglong) byte_count > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
--- 1.199/sql/item_sum.cc 2006-11-29 11:44:49 +03:00
+++ 1.200/sql/item_sum.cc 2006-11-29 11:44:49 +03:00
@@ -322,9 +322,13 @@ void Item_sum::make_field(Send_field *tm
if (args[0]->type() == Item::FIELD_ITEM && keep_field_type())
{
((Item_field*) args[0])->field->make_field(tmp_field);
- tmp_field->db_name=(char*)"";
- tmp_field->org_table_name=tmp_field->table_name=(char*)"";
- tmp_field->org_col_name=tmp_field->col_name=name;
+ /* For expressions only col_name should be non-empty string. */
+ char *empty_string= (char*)"";
+ tmp_field->db_name= empty_string;
+ tmp_field->org_table_name= empty_string;
+ tmp_field->table_name= empty_string;
+ tmp_field->org_col_name= empty_string;
+ tmp_field->col_name= name;
if (maybe_null)
tmp_field->flags&= ~NOT_NULL_FLAG;
}
--- 1.593/sql/mysqld.cc 2006-11-29 11:44:49 +03:00
+++ 1.594/sql/mysqld.cc 2006-11-29 11:44:49 +03:00
@@ -6333,6 +6333,16 @@ static int show_open_tables(THD *thd, SH
return 0;
}
+static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff)
+{
+ var->type= SHOW_LONG;
+ var->value= buff;
+ pthread_mutex_lock(&LOCK_prepared_stmt_count);
+ *((long *)buff)= (long)prepared_stmt_count;
+ pthread_mutex_unlock(&LOCK_prepared_stmt_count);
+ return 0;
+}
+
static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_LONG;
@@ -6743,6 +6753,7 @@ SHOW_VAR status_vars[]= {
{"Open_table_definitions", (char*) &show_table_definitions, SHOW_FUNC},
{"Open_tables", (char*) &show_open_tables, SHOW_FUNC},
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables),
SHOW_LONG_STATUS},
+ {"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC},
#ifdef HAVE_QUERY_CACHE
{"Qcache_free_blocks", (char*) &query_cache.free_memory_blocks,
SHOW_LONG_NOFLUSH},
{"Qcache_free_memory", (char*) &query_cache.free_memory, SHOW_LONG_NOFLUSH},
@@ -6922,6 +6933,7 @@ static void mysql_init_variables(void)
binlog_cache_use= binlog_cache_disk_use= 0;
max_used_connections= slow_launch_threads = 0;
mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0;
+ prepared_stmt_count= 0;
errmesg= 0;
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
bzero((gptr) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
--- 1.208/sql/sql_lex.cc 2006-11-29 11:44:49 +03:00
+++ 1.209/sql/sql_lex.cc 2006-11-29 11:44:49 +03:00
@@ -176,7 +176,8 @@ void lex_start(THD *thd, const uchar *bu
lex->reset_query_tables_list(FALSE);
lex->expr_allows_subselect= TRUE;
- lex->name= 0;
+ lex->name.str= 0;
+ lex->name.length= 0;
lex->event_parse_data= NULL;
lex->nest_level=0 ;
@@ -1449,7 +1450,7 @@ bool st_select_lex::add_order_to_list(TH
bool st_select_lex::add_item_to_list(THD *thd, Item *item)
{
DBUG_ENTER("st_select_lex::add_item_to_list");
- DBUG_PRINT("info", ("Item: %p", item));
+ DBUG_PRINT("info", ("Item: 0x%lx", (long) item));
DBUG_RETURN(item_list.push_back(item));
}
--- 1.247/sql/sql_lex.h 2006-11-29 11:44:49 +03:00
+++ 1.248/sql/sql_lex.h 2006-11-29 11:44:49 +03:00
@@ -1231,4 +1231,6 @@ extern void lex_end(LEX *lex);
extern int MYSQLlex(void *arg, void *yythd);
extern const uchar *skip_rear_comments(const uchar *ubegin, const uchar *uend);
+extern bool is_lex_native_function(const LEX_STRING *name);
+
#endif /* MYSQL_SERVER */
--- 1.515/sql/sql_yacc.yy 2006-11-29 11:44:49 +03:00
+++ 1.516/sql/sql_yacc.yy 2006-11-29 11:44:49 +03:00
@@ -746,7 +746,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
UNDERSCORE_CHARSET IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
NCHAR_STRING opt_component key_cache_name
- sp_opt_label BIN_NUM label_ident TEXT_STRING_filesystem
+ sp_opt_label BIN_NUM label_ident TEXT_STRING_filesystem ident_or_empty
%type <lex_str_ptr>
opt_table_alias
@@ -756,7 +756,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
- opt_constraint constraint ident_or_empty
+ opt_constraint constraint
%type <string>
text_string opt_gconcat_separator
@@ -1240,7 +1240,8 @@ create:
lex->create_info.options=$2 | $4;
lex->create_info.db_type= lex->thd->variables.table_type;
lex->create_info.default_table_charset= NULL;
- lex->name= 0;
+ lex->name.str= 0;
+ lex->name.length= 0;
lex->like_name= 0;
}
create2
@@ -1280,7 +1281,7 @@ create:
{
LEX *lex=Lex;
lex->sql_command=SQLCOM_CREATE_DB;
- lex->name=$4.str;
+ lex->name= $4;
lex->create_info.options=$3;
}
| CREATE
@@ -1515,7 +1516,7 @@ clear_privileges:
sp_name:
ident '.' ident
{
- if (!$1.str || check_db_name($1.str))
+ if (!$1.str || check_db_name(&$1))
{
my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
YYABORT;
@@ -3148,7 +3149,7 @@ size_number:
uint text_shift_number= 0;
longlong prefix_number;
char *start_ptr= $1.str;
- uint str_len= strlen(start_ptr);
+ uint str_len= $1.length;
char *end_ptr= start_ptr + str_len;
int error;
prefix_number= my_strtoll10(start_ptr, &end_ptr, &error);
@@ -4672,7 +4673,8 @@ alter:
{
THD *thd= YYTHD;
LEX *lex= thd->lex;
- lex->name= 0;
+ lex->name.str= 0;
+ lex->name.length= 0;
lex->sql_command= SQLCOM_ALTER_TABLE;
lex->duplicates= DUP_ERROR;
if (!lex->select_lex.add_table_to_list(thd, $4, NULL,
@@ -4682,7 +4684,6 @@ alter:
lex->key_list.empty();
lex->col_list.empty();
lex->select_lex.init_order();
- lex->name= 0;
lex->like_name= 0;
lex->select_lex.db=
((TABLE_LIST*) lex->select_lex.table_list.first)->db;
@@ -4707,7 +4708,8 @@ alter:
THD *thd= Lex->thd;
lex->sql_command=SQLCOM_ALTER_DB;
lex->name= $3;
- if (lex->name == NULL && thd->copy_db_to(&lex->name,
NULL))
+ if (lex->name.str == NULL &&
+ thd->copy_db_to(&lex->name.str, &lex->name.length))
YYABORT;
}
| ALTER PROCEDURE sp_name
@@ -4857,8 +4859,8 @@ opt_ev_sql_stmt: /* empty*/ { $$= 0;}
ident_or_empty:
- /* empty */ { $$= 0; }
- | ident { $$= $1.str; };
+ /* empty */ { $$.str= 0; $$.length= 0; }
+ | ident { $$= $1; };
alter_commands:
| DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; }
@@ -5136,19 +5138,20 @@ alter_list_item:
{
LEX *lex=Lex;
THD *thd= lex->thd;
+ uint dummy;
lex->select_lex.db=$3->db.str;
if (lex->select_lex.db == NULL &&
- thd->copy_db_to(&lex->select_lex.db, NULL))
+ thd->copy_db_to(&lex->select_lex.db, &dummy))
{
YYABORT;
}
if (check_table_name($3->table.str,$3->table.length) ||
- $3->db.str && check_db_name($3->db.str))
+ $3->db.str && check_db_name(&$3->db))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
YYABORT;
}
- lex->name= $3->table.str;
+ lex->name= $3->table;
lex->alter_info.flags|= ALTER_RENAME;
}
| CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
@@ -7681,7 +7684,7 @@ drop:
LEX *lex=Lex;
lex->sql_command= SQLCOM_DROP_DB;
lex->drop_if_exists=$3;
- lex->name=$4.str;
+ lex->name= $4;
}
| DROP FUNCTION_SYM if_exists sp_name
{
@@ -8328,7 +8331,7 @@ show_param:
{
Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
Lex->create_info.options=$3;
- Lex->name=$4.str;
+ Lex->name= $4;
}
| CREATE TABLE_SYM table_ident
{
@@ -10333,7 +10336,8 @@ grant_ident:
{
LEX *lex= Lex;
THD *thd= lex->thd;
- if (thd->copy_db_to(&lex->current_select->db, NULL))
+ uint dummy;
+ if (thd->copy_db_to(&lex->current_select->db, &dummy))
YYABORT;
if (lex->grant == GLOBAL_ACLS)
lex->grant = DB_ACLS & ~GRANT_ACL;
--- 1.18/BitKeeper/etc/collapsed 2006-11-29 11:44:49 +03:00
+++ 1.19/BitKeeper/etc/collapsed 2006-11-29 11:44:49 +03:00
@@ -15,7 +15,8 @@
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
-452c6c6dAjuNghfc1ObZ_UQ5SCl85g
-4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ
+4561b2ecZbhuAc0TTDdCdultxUYaMw
+4561bde4qWhz1I8tkItXKex5uniipA
+4562ba016dYH0JzszOqZ8p6psbKfnQ
--- 1.201/sql/set_var.cc 2006-11-29 11:44:49 +03:00
+++ 1.202/sql/set_var.cc 2006-11-29 11:44:49 +03:00
@@ -3930,7 +3930,7 @@ sys_var_event_scheduler::update(THD *thd
DBUG_RETURN(TRUE);
}
- DBUG_PRINT("new_value", ("%lu", (bool)var->save_result.ulong_value));
+ DBUG_PRINT("info", ("new_value: %d", (int) var->save_result.ulong_value));
Item_result var_type= var->value->result_type();
--- 1.98/mysql-test/t/func_str.test 2006-11-29 11:44:49 +03:00
+++ 1.99/mysql-test/t/func_str.test 2006-11-29 11:44:49 +03:00
@@ -300,18 +300,26 @@ select POSITION(_latin1'B' COLLATE latin
select POSITION(_latin1'B' IN _latin2'abcd');
select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d');
---fix this:
---select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin);
---select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
+
+# fix this:
+--disable_parsing
+select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin);
+select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
+--enable_parsing
+
--error 1267
select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE
latin1_bin);
--error 1267
select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d');
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2);
---fix this:
---select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
---select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
+
+# fix this:
+--disable_parsing
+select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
+select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
+--enable_parsing
+
--error 1267
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2);
--error 1267
--- 1.90/mysql-test/r/ps.result 2006-11-29 11:44:49 +03:00
+++ 1.91/mysql-test/r/ps.result 2006-11-29 11:44:49 +03:00
@@ -2099,14 +2099,6 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`r
deallocate prepare abc;
drop view v1;
drop table t1;
-create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
-call proc_1();
-ERROR HY000: No paths allowed for shared library
-call proc_1();
-ERROR HY000: No paths allowed for shared library
-call proc_1();
-ERROR HY000: No paths allowed for shared library
-drop procedure proc_1;
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
call proc_1();
ERROR HY000: Can't open shared library
@@ -2121,12 +2113,6 @@ select func_1(), func_1(), func_1() from
ERROR 42000: FUNCTION test.func_1 does not exist
drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
-prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
-execute abc;
-ERROR HY000: No paths allowed for shared library
-execute abc;
-ERROR HY000: No paths allowed for shared library
-deallocate prepare abc;
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
deallocate prepare abc;
create procedure proc_1() uninstall plugin my_plug;
--- 1.89/mysql-test/t/ps.test 2006-11-29 11:44:49 +03:00
+++ 1.90/mysql-test/t/ps.test 2006-11-29 11:44:49 +03:00
@@ -2097,14 +2097,6 @@ drop view v1;
drop table t1;
-create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
---error ER_UDF_NO_PATHS
-call proc_1();
---error ER_UDF_NO_PATHS
-call proc_1();
---error ER_UDF_NO_PATHS
-call proc_1();
-drop procedure proc_1;
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
--replace_regex /(Can\'t open shared library).*$/\1/
--error ER_CANT_OPEN_LIBRARY
@@ -2124,12 +2116,6 @@ delimiter ;|
select func_1(), func_1(), func_1() from dual;
--error ER_SP_DOES_NOT_EXIST
drop function func_1;
-prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
---error ER_UDF_NO_PATHS
-execute abc;
---error ER_UDF_NO_PATHS
-execute abc;
-deallocate prepare abc;
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
deallocate prepare abc;
--- 1.220/tests/mysql_client_test.c 2006-11-29 11:44:50 +03:00
+++ 1.221/tests/mysql_client_test.c 2006-11-29 11:44:50 +03:00
@@ -15541,6 +15541,151 @@ static void test_bug21726()
/*
+ BUG#23383: mysql_affected_rows() returns different values than
+ mysql_stmt_affected_rows()
+
+ Test that both mysql_affected_rows() and mysql_stmt_affected_rows()
+ return -1 on error, 0 when no rows were affected, and (positive) row
+ count when some rows were affected.
+*/
+static void test_bug23383()
+{
+ const char *insert_query= "INSERT INTO t1 VALUES (1), (2)";
+ const char *update_query= "UPDATE t1 SET i= 4 WHERE i = 3";
+ MYSQL_STMT *stmt;
+ my_ulonglong row_count;
+ int rc;
+
+ DBUG_ENTER("test_bug23383");
+ myheader("test_bug23383");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql, "CREATE TABLE t1 (i INT UNIQUE)");
+ myquery(rc);
+
+ rc= mysql_query(mysql, insert_query);
+ myquery(rc);
+ row_count= mysql_affected_rows(mysql);
+ DIE_UNLESS(row_count == 2);
+
+ rc= mysql_query(mysql, insert_query);
+ DIE_UNLESS(rc != 0);
+ row_count= mysql_affected_rows(mysql);
+ DIE_UNLESS(row_count == (my_ulonglong)-1);
+
+ rc= mysql_query(mysql, update_query);
+ myquery(rc);
+ row_count= mysql_affected_rows(mysql);
+ DIE_UNLESS(row_count == 0);
+
+ rc= mysql_query(mysql, "DELETE FROM t1");
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+ DIE_UNLESS(stmt != 0);
+
+ rc= mysql_stmt_prepare(stmt, insert_query, strlen(insert_query));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ row_count= mysql_stmt_affected_rows(stmt);
+ DIE_UNLESS(row_count == 2);
+
+ rc= mysql_stmt_execute(stmt);
+ DIE_UNLESS(rc != 0);
+ row_count= mysql_stmt_affected_rows(stmt);
+ DIE_UNLESS(row_count == (my_ulonglong)-1);
+
+ rc= mysql_stmt_prepare(stmt, update_query, strlen(update_query));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ row_count= mysql_stmt_affected_rows(stmt);
+ DIE_UNLESS(row_count == 0);
+
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ BUG#21635: MYSQL_FIELD struct's member strings seem to misbehave for
+ expression cols
+
+ Check that for MIN(), MAX(), COUNT() only MYSQL_FIELD::name is set
+ to either expression or its alias, and db, org_table, table,
+ org_name fields are empty strings.
+*/
+static void test_bug21635()
+{
+ const char *expr[]=
+ {
+ "MIN(i)", "MIN(i)",
+ "MIN(i) AS A1", "A1",
+ "MAX(i)", "MAX(i)",
+ "MAX(i) AS A2", "A2",
+ "COUNT(i)", "COUNT(i)",
+ "COUNT(i) AS A3", "A3",
+ };
+ char query[MAX_TEST_QUERY_LENGTH];
+ char *query_end;
+ MYSQL_RES *result;
+ MYSQL_FIELD *field;
+ unsigned int field_count, i;
+ int rc;
+
+ DBUG_ENTER("test_bug21635");
+ myheader("test_bug21635");
+
+ query_end= strxmov(query, "SELECT ", NullS);
+ for (i= 0; i < sizeof(expr) / sizeof(*expr) / 2; ++i)
+ query_end= strxmov(query_end, expr[i * 2], ", ", NullS);
+ query_end= strxmov(query_end - 2, " FROM t1 GROUP BY i", NullS);
+ DIE_UNLESS(query_end - query < MAX_TEST_QUERY_LENGTH);
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE TABLE t1 (i INT)");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)");
+ myquery(rc);
+
+ rc= mysql_real_query(mysql, query, query_end - query);
+ myquery(rc);
+
+ result= mysql_use_result(mysql);
+ DIE_UNLESS(result);
+
+ field_count= mysql_field_count(mysql);
+ for (i= 0; i < field_count; ++i)
+ {
+ field= mysql_fetch_field_direct(result, i);
+ printf("%s -> %s ... ", expr[i * 2], field->name);
+ fflush(stdout);
+ DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 &&
+ field->table[0] == 0 && field->org_name[0] == 0);
+ DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0);
+ puts("OK");
+ }
+
+ mysql_free_result(result);
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -15818,6 +15963,8 @@ static struct my_tests_st my_tests[]= {
{ "test_bug19671", test_bug19671 },
{ "test_bug21206", test_bug21206 },
{ "test_bug21726", test_bug21726 },
+ { "test_bug23383", test_bug23383 },
+ { "test_bug21635", test_bug21635 },
{ "test_status", test_status},
{ 0, 0 }
};
| Thread |
|---|
| • bk commit into 5.1 tree (kostja:1.2382) | konstantin | 29 Nov |