Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty 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
1.1917 05/07/31 12:49:55 monty@stripped +32 -0
Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment
parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger
files.
sql/tztime.h
1.12 05/07/31 12:49:47 monty@stripped +1 -1
bool -> my_bool (to allow calling C code from C++ code)
sql/tztime.cc
1.25 05/07/31 12:49:47 monty@stripped +22 -12
bool -> my_bool (to allow calling C code from C++ code)
sql/time.cc
1.57 05/07/31 12:49:47 monty@stripped +1 -1
New prototype for TIME_to_timestamp() to allow easyer mapping to C function
sql/sql_view.cc
1.54 05/07/31 12:49:47 monty@stripped +5 -4
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/sql_trigger.cc
1.25 05/07/31 12:49:47 monty@stripped +11 -11
Use 'tables_alias_charset' for comparing database name
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/sql_select.cc
1.346 05/07/31 12:49:47 monty@stripped +20 -23
Portability fixes
After review fixes
sql/sql_class.cc
1.195 05/07/31 12:49:47 monty@stripped +4 -0
Added comment
sql/sql_base.cc
1.274 05/07/31 12:49:47 monty@stripped +7 -1
Added function is_equal()
Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW")
sql/set_var.cc
1.127 05/07/31 12:49:47 monty@stripped +8 -2
Added overflow checking when setting ulong variable
sql/mysql_priv.h
1.335 05/07/31 12:49:47 monty@stripped +3 -3
New prototype for TIME_to_timestamp()
Added function for comparing LEX_STRING
sql/log.cc
1.167 05/07/31 12:49:47 monty@stripped +5 -1
Remove compiler warnings
sql/item_timefunc.cc
1.91 05/07/31 12:49:46 monty@stripped +2 -2
New prototype for TIME_to_timestamp()
sql/item.h
1.158 05/07/31 12:49:46 monty@stripped +1 -2
Don't have prototypes for both uint32 and ulong as these 'may' be the same thing
sql/field.cc
1.280 05/07/31 12:49:46 monty@stripped +11 -11
Test number_to_datetime() for -1 instead of < 0 (Safety fix)
New prototype for TIME_to_timestamp()
sql-common/my_time.c
1.15 05/07/31 12:49:46 monty@stripped +16 -17
Change bool -> my_bool as bool is not portable in C programs
mysys/thr_lock.c
1.47 05/07/31 12:49:46 monty@stripped +3 -3
Remove not needed casts
mysys/my_static.c
1.16 05/07/31 12:49:46 monty@stripped +2 -1
May my_progname const
mysys/my_init.c
1.40 05/07/31 12:49:46 monty@stripped +1 -1
May my_progname const
mysql-test/t/view.test
1.91 05/07/31 12:49:46 monty@stripped +5 -4
USe --enable/disable parsing instead of comments
mysql-test/t/variables.test
1.45 05/07/31 12:49:46 monty@stripped +4 -3
Portability fix for 64 bit systems
mysql-test/t/sp.test
1.135 05/07/31 12:49:46 monty@stripped +153 -141
USe --enable/disable parsing instead of comments
mysql-test/t/mysqltest.test
1.9 05/07/31 12:49:46 monty@stripped +11 -0
Test for --enable_parsing
mysql-test/t/information_schema.test
1.47 05/07/31 12:49:46 monty@stripped +21 -19
USe --enable/disable parsing instead of comments
mysql-test/r/variables.result
1.68 05/07/31 12:49:46 monty@stripped +9 -9
Update results after fix for overflow checking of max_heap_table_size
mysql-test/r/mysqltest.result
1.8 05/07/31 12:49:46 monty@stripped +2 -0
Test for --enable_parsing
mysql-test/lib/init_db.sql
1.11 05/07/31 12:49:46 monty@stripped +4 -4
Align with mysql_create_system_tables
(Ideally this file should be auto-generated from the above script)
include/my_time.h
1.11 05/07/31 12:49:46 monty@stripped +4 -3
Avoid using 'bool' in C programs
include/my_sys.h
1.164 05/07/31 12:49:46 monty@stripped +1 -1
Make my_progname const
client/mysqltest.c
1.152 05/07/31 12:49:46 monty@stripped +39 -11
Added --enable_parsning and --disable_parsing to avoid to have to comment parts of
tests
client/mysqldump.c
1.192 05/07/31 12:49:45 monty@stripped +5 -3
Added OPT_TRIGGERS (to get rid of compiler warning)
Abort if we can't write to outfile (even if --ignore-errors is given)
client/mysql.cc
1.176 05/07/31 12:49:45 monty@stripped +1 -1
Added cast to get rid of compiler warning
client/client_priv.h
1.38 05/07/31 12:49:45 monty@stripped +2 -1
Added OPT_TRIGGERS (to get rid of compiler warning)
# 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: monty
# Host: mishka.local
# Root: /home/my/mysql-5.0
--- 1.175/client/mysql.cc 2005-07-18 15:31:57 +03:00
+++ 1.176/client/mysql.cc 2005-07-31 12:49:45 +03:00
@@ -432,7 +432,7 @@
put_info((char*) glob_buffer.ptr(),INFO_INFO);
#ifdef HAVE_READLINE
- initialize_readline(my_progname);
+ initialize_readline((char*) my_progname);
if (!status.batch && !quick && !opt_html && !opt_xml)
{
/* read-history from file, default ~/.mysql_history*/
--- 1.191/client/mysqldump.c 2005-07-22 05:11:20 +03:00
+++ 1.192/client/mysqldump.c 2005-07-31 12:49:45 +03:00
@@ -372,7 +372,7 @@
(gptr*) &path, (gptr*) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tables", OPT_TABLES, "Overrides option --databases (-B).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"triggers", '/0', "Dump triggers for each dumped table",
+ {"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table",
(gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
@@ -424,6 +424,7 @@
if (ferror(file))
{
fprintf(stderr, "%s: Got errno %d on write\n", my_progname, errno);
+ ignore_errors= 0; /* We can't ignore this error */
safe_exit(EX_EOF);
}
}
@@ -2610,7 +2611,7 @@
{
/* SHOW MASTER STATUS reports nothing and --force is not enabled */
my_printf_error(0, "Error: Binlogging on server not active",
- MYF(0), mysql_error(mysql_con));
+ MYF(0));
mysql_free_result(master);
return 1;
}
@@ -2979,11 +2980,12 @@
int main(int argc, char **argv)
{
+ MY_INIT("mysqldump");
+
compatible_mode_normal_str[0]= 0;
default_charset= (char *)mysql_universal_client_charset;
bzero((char*) &ignore_table, sizeof(ignore_table));
- MY_INIT("mysqldump");
if (get_options(&argc, &argv))
{
my_end(0);
--- 1.163/include/my_sys.h 2005-07-21 07:35:55 +03:00
+++ 1.164/include/my_sys.h 2005-07-31 12:49:46 +03:00
@@ -218,7 +218,7 @@
#endif /* #ifndef errno */
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */
-extern char *my_progname; /* program-name (printed in errors) */
+extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
--- 1.39/mysys/my_init.c 2005-02-28 11:59:41 +02:00
+++ 1.40/mysys/my_init.c 2005-07-31 12:49:46 +03:00
@@ -96,7 +96,7 @@
#endif
{
DBUG_ENTER("my_init");
- DBUG_PROCESS(my_progname ? my_progname : (char*) "unknown");
+ DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown"));
if (!home_dir)
{ /* Don't initialize twice */
my_win_init();
--- 1.15/mysys/my_static.c 2005-01-26 16:37:34 +02:00
+++ 1.16/mysys/my_static.c 2005-07-31 12:49:46 +03:00
@@ -28,7 +28,8 @@
my_bool timed_mutexes= 0;
/* from my_init */
-my_string home_dir=0,my_progname=0;
+my_string home_dir=0;
+const char *my_progname=0;
char NEAR curr_dir[FN_REFLEN]= {0},
NEAR home_dir_buff[FN_REFLEN]= {0};
ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0;
--- 1.46/mysys/thr_lock.c 2005-07-28 16:12:38 +03:00
+++ 1.47/mysys/thr_lock.c 2005-07-31 12:49:46 +03:00
@@ -509,7 +509,7 @@
(*lock->read.last)=data; /* Add to running FIFO */
data->prev=lock->read.last;
lock->read.last= &data->next;
- if ((int) lock_type == (int) TL_READ_NO_INSERT)
+ if (lock_type == TL_READ_NO_INSERT)
lock->read_no_write_count++;
check_locks(lock,"read lock with old write lock",0);
if (lock->get_status)
@@ -535,14 +535,14 @@
lock->read.last= &data->next;
if (lock->get_status)
(*lock->get_status)(data->status_param, 0);
- if ((int) lock_type == (int) TL_READ_NO_INSERT)
+ if (lock_type == TL_READ_NO_INSERT)
lock->read_no_write_count++;
check_locks(lock,"read lock with no write locks",0);
statistic_increment(locks_immediate,&THR_LOCK_lock);
goto end;
}
/*
- We're here if there is an active write lock or no write
+ We're here if there is an active write lock or no write
lock but a high priority write waiting in the write_wait queue.
In the latter case we should yield the lock to the writer.
*/
--- 1.279/sql/field.cc 2005-07-27 13:04:11 +03:00
+++ 1.280/sql/field.cc 2005-07-31 12:49:46 +03:00
@@ -4468,7 +4468,7 @@
my_time_t tmp= 0;
int error;
bool have_smth_to_conv;
- bool in_dst_time_gap;
+ my_bool in_dst_time_gap;
THD *thd= table->in_use;
/* We don't want to store invalid or fuzzy datetime values in TIMESTAMP */
@@ -4539,14 +4539,14 @@
TIME l_time;
my_time_t timestamp= 0;
int error;
- bool in_dst_time_gap;
+ my_bool in_dst_time_gap;
THD *thd= table->in_use;
/* We don't want to store invalid or fuzzy datetime values in TIMESTAMP */
longlong tmp= number_to_datetime(nr, &l_time, (thd->variables.sql_mode &
MODE_NO_ZERO_DATE) |
MODE_NO_ZERO_IN_DATE, &error);
- if (tmp < 0)
+ if (tmp == LL(-1))
{
error= 2;
}
@@ -5215,7 +5215,7 @@
MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error);
- if (nr < 0)
+ if (nr == LL(-1))
{
nr= 0;
error= 2;
@@ -5391,12 +5391,12 @@
TIME l_time;
longlong tmp;
int error;
- if ((tmp= number_to_datetime(nr, &l_time,
- (TIME_FUZZY_DATE |
- (table->in_use->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
- MODE_INVALID_DATES))),
- &error) < 0))
+ if (number_to_datetime(nr, &l_time,
+ (TIME_FUZZY_DATE |
+ (table->in_use->variables.sql_mode &
+ (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE |
+ MODE_INVALID_DATES))),
+ &error) == LL(-1))
{
tmp= 0L;
error= 2;
@@ -5593,7 +5593,7 @@
MODE_NO_ZERO_DATE |
MODE_INVALID_DATES))), &error);
- if (nr < 0)
+ if (nr == LL(-1))
{
nr= 0;
error= 2;
--- 1.157/sql/item.h 2005-07-28 20:40:40 +03:00
+++ 1.158/sql/item.h 2005-07-31 12:49:46 +03:00
@@ -1150,8 +1150,7 @@
{
public:
Item_uint(const char *str_arg, uint length);
- Item_uint(uint32 i) :Item_int((ulonglong) i, 10) {}
- Item_uint(ulong i) :Item_int((ulonglong) i, 10) {}
+ Item_uint(ulonglong i) :Item_int((ulonglong) i, 10) {}
Item_uint(const char *str_arg, longlong i, uint length);
double val_real()
{ DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
--- 1.90/sql/item_timefunc.cc 2005-07-20 02:33:18 +03:00
+++ 1.91/sql/item_timefunc.cc 2005-07-31 12:49:46 +03:00
@@ -1070,7 +1070,7 @@
longlong Item_func_unix_timestamp::val_int()
{
TIME ltime;
- bool not_used;
+ my_bool not_used;
DBUG_ASSERT(fixed == 1);
if (arg_count == 0)
@@ -1798,7 +1798,6 @@
uint fuzzy_date __attribute__((unused)))
{
my_time_t my_time_tmp;
- bool not_used;
String str;
if (!from_tz_cached)
@@ -1824,6 +1823,7 @@
ltime->year==TIMESTAMP_MAX_YEAR && ltime->month==1 &&
ltime->day==1 ||
ltime->year==TIMESTAMP_MIN_YEAR && ltime->month==12 &&
ltime->day==31)
{
+ my_bool not_used;
my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used);
if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <=
TIMESTAMP_MAX_VALUE)
to_tz->gmt_sec_to_TIME(ltime, my_time_tmp);
--- 1.166/sql/log.cc 2005-07-28 16:08:52 +03:00
+++ 1.167/sql/log.cc 2005-07-31 12:49:47 +03:00
@@ -58,7 +58,11 @@
binlog_prepare,
NULL, /* recover */
NULL, /* commit_by_xid */
- NULL /* rollback_by_xid */
+ NULL, /* rollback_by_xid */
+ NULL, /* create_cursor_read_view */
+ NULL, /* set_cursor_read_view */
+ NULL, /* close_cursor_read_view */
+ HTON_NO_FLAGS
};
/*
--- 1.334/sql/mysql_priv.h 2005-07-28 17:09:49 +03:00
+++ 1.335/sql/mysql_priv.h 2005-07-31 12:49:47 +03:00
@@ -823,8 +823,6 @@
bool mysqld_help (THD *thd, const char *text);
void calc_sum_of_all_status(STATUS_VAR *to);
-
-
/* information schema */
extern LEX_STRING information_schema_name;
LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
@@ -952,6 +950,7 @@
const char *table_name);
void remove_db_from_cache(const char *db);
void flush_tables();
+bool is_equal(const LEX_STRING *a, const LEX_STRING *b);
/* bits for last argument to remove_table_from_cache() */
#define RTFC_NO_FLAG 0x0000
@@ -1191,6 +1190,7 @@
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
extern const char* any_db;
extern struct my_option my_long_options[];
+extern const LEX_STRING view_type;
/* optional things, have_* variables */
@@ -1273,7 +1273,7 @@
ulong convert_month_to_period(ulong month);
void get_date_from_daynr(long daynr,uint *year, uint *month,
uint *day);
-my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *not_exist);
+my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *not_exist);
bool str_to_time_with_warn(const char *str,uint length,TIME *l_time);
timestamp_type str_to_datetime_with_warn(const char *str, uint length,
TIME *l_time, uint flags);
--- 1.273/sql/sql_base.cc 2005-07-28 16:12:38 +03:00
+++ 1.274/sql/sql_base.cc 2005-07-31 12:49:47 +03:00
@@ -4258,7 +4258,7 @@
if ((parser= sql_parse_prepare(&pathstr, mem_root, 1)))
{
- if (!strncmp("VIEW", parser->type()->str, parser->type()->length))
+ if (is_equal(&view_type, parser->type()))
{
if (table_desc == 0 || table_desc->required_type == FRMTYPE_TABLE)
{
@@ -4280,4 +4280,10 @@
err:
bzero(outparam, sizeof(TABLE)); // do not run repair
DBUG_RETURN(1);
+}
+
+
+bool is_equal(const LEX_STRING *a, const LEX_STRING *b)
+{
+ return a->length == b->length && !strncmp(a->str, b->str,
a->length);
}
--- 1.194/sql/sql_class.cc 2005-07-19 21:21:02 +03:00
+++ 1.195/sql/sql_class.cc 2005-07-31 12:49:47 +03:00
@@ -523,6 +523,10 @@
if this is the slave SQL thread.
*/
variables.pseudo_thread_id= thread_id;
+ /*
+ We have to call thr_lock_info_init() again here as THD may have been
+ created in another thread
+ */
thr_lock_info_init(&lock_info);
return 0;
}
--- 1.345/sql/sql_select.cc 2005-07-28 16:12:38 +03:00
+++ 1.346/sql/sql_select.cc 2005-07-31 12:49:47 +03:00
@@ -1762,7 +1762,7 @@
for (handlerton **pht= thd->transaction.stmt.ht; *pht; pht++)
{
const handlerton *ht= *pht;
- close_at_commit|= (ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT);
+ close_at_commit|= test(ht->flags & HTON_CLOSE_CURSORS_AT_COMMIT);
if (ht->create_cursor_read_view)
{
info->ht= ht;
@@ -8033,11 +8033,13 @@
bool table_cant_handle_bit_fields,
uint convert_blob_length)
{
- Item *org_item= item;
- if (item->real_item()->type() == Item::FIELD_ITEM)
+ if (type != Item::FIELD_ITEM &&
+ item->real_item()->type() == Item::FIELD_ITEM &&
+ (item->type() != Item::REF_ITEM ||
+ !((Item_ref *) item)->depended_from))
{
item= item->real_item();
- type= item->type();
+ type= Item::FIELD_ITEM;
}
switch (type) {
case Item::SUM_FUNC_ITEM:
@@ -8051,23 +8053,18 @@
case Item::FIELD_ITEM:
case Item::DEFAULT_VALUE_ITEM:
{
- if (org_item->type() != Item::REF_ITEM ||
- !((Item_ref *)org_item)->depended_from)
- {
- Item_field *field= (Item_field*) item;
- if (table_cant_handle_bit_fields &&
- field->field->type() == FIELD_TYPE_BIT)
- return create_tmp_field_from_item(thd, item, table, copy_func,
- modify_item, convert_blob_length);
- return create_tmp_field_from_field(thd, (*from_field= field->field),
- item->name, table,
- modify_item ? (Item_field*) item :
- NULL,
- convert_blob_length);
- }
- else
- item= org_item;
+ Item_field *field= (Item_field*) item;
+ if (table_cant_handle_bit_fields &&
+ field->field->type() == FIELD_TYPE_BIT)
+ return create_tmp_field_from_item(thd, item, table, copy_func,
+ modify_item, convert_blob_length);
+ return create_tmp_field_from_field(thd, (*from_field= field->field),
+ item->name, table,
+ modify_item ? (Item_field*) item :
+ NULL,
+ convert_blob_length);
}
+ /* Fall through */
case Item::FUNC_ITEM:
case Item::COND_ITEM:
case Item::FIELD_AVG_ITEM:
@@ -10910,13 +10907,13 @@
usable_keys.set_all();
for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
{
- if ((*tmp_order->item)->real_item()->type() != Item::FIELD_ITEM)
+ Item *item= (*tmp_order->item)->real_item();
+ if (item->type() != Item::FIELD_ITEM)
{
usable_keys.clear_all();
DBUG_RETURN(0);
}
- usable_keys.intersect(((Item_field*) (*tmp_order->item)->real_item())->
- field->part_of_sortkey);
+ usable_keys.intersect(((Item_field*) item)->field->part_of_sortkey);
if (usable_keys.is_clear_all())
DBUG_RETURN(0); // No usable keys
}
--- 1.56/sql/time.cc 2005-04-04 16:43:20 +03:00
+++ 1.57/sql/time.cc 2005-07-31 12:49:47 +03:00
@@ -223,7 +223,7 @@
0 - t contains datetime value which is out of TIMESTAMP range.
*/
-my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *in_dst_time_gap)
+my_time_t TIME_to_timestamp(THD *thd, const TIME *t, my_bool *in_dst_time_gap)
{
my_time_t timestamp;
--- 1.90/mysql-test/t/view.test 2005-07-25 19:07:39 +03:00
+++ 1.91/mysql-test/t/view.test 2005-07-31 12:49:46 +03:00
@@ -147,10 +147,11 @@
create view v1 (a) as select a+1 from t1;
create view v2 (a) as select a-1 from t1;
-# WL #2486 should enable these tests
-#select * from t1 natural left join v1;
-#select * from v2 natural left join t1;
-#select * from v2 natural left join v1;
+--disable_parsing WL #2486 should enable these tests
+select * from t1 natural left join v1;
+select * from v2 natural left join t1;
+select * from v2 natural left join v1;
+--enable_parsing
drop view v1, v2;
drop table t1;
--- 1.53/sql/sql_view.cc 2005-07-12 18:33:56 +03:00
+++ 1.54/sql/sql_view.cc 2005-07-31 12:49:47 +03:00
@@ -24,6 +24,8 @@
#define MD5_BUFF_LENGTH 33
+const LEX_STRING view_type= { (char*) STRING_WITH_LEN("VIEW") };
+
static int mysql_register_view(THD *thd, TABLE_LIST *view,
enum_view_create_mode mode);
@@ -431,7 +433,7 @@
FILE_OPTIONS_STRING}
};
-static LEX_STRING view_file_type[]= {{(char*)"VIEW", 4}};
+static LEX_STRING view_file_type[]= {{(char*) STRING_WITH_LEN("VIEW") }};
/*
@@ -470,7 +472,7 @@
thd->variables.sql_mode|= sql_mode;
}
str.append('\0');
- DBUG_PRINT("VIEW", ("View: %s", str.ptr()));
+ DBUG_PRINT("info", ("View: %s", str.ptr()));
/* print file name */
(void) my_snprintf(dir_buff, FN_REFLEN, "%s/%s/",
@@ -507,8 +509,7 @@
if (!(parser= sql_parse_prepare(&path, thd->mem_root, 0)))
DBUG_RETURN(1);
- if (!parser->ok() ||
- strncmp("VIEW", parser->type()->str, parser->type()->length))
+ if (!parser->ok() || !is_equal(&view_type, parser->type()))
{
my_error(ER_WRONG_OBJECT, MYF(0),
(view->db ? view->db : thd->db), view->table_name, "VIEW");
--- 1.24/sql/tztime.cc 2005-06-06 21:21:28 +03:00
+++ 1.25/sql/tztime.cc 2005-07-31 12:49:47 +03:00
@@ -880,12 +880,12 @@
0 in case of error.
*/
static my_time_t
-TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap)
+TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp,
+ my_bool *in_dst_time_gap)
{
my_time_t local_t;
uint saved_seconds;
uint i;
-
DBUG_ENTER("TIME_to_gmt_sec");
/* We need this for correct leap seconds handling */
@@ -962,7 +962,7 @@
{
public:
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
@@ -994,7 +994,7 @@
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_system::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
long not_used;
return my_system_gmt_sec(t, ¬_used, in_dst_time_gap);
@@ -1055,7 +1055,7 @@
{
public:
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
};
@@ -1081,7 +1081,7 @@
0
*/
my_time_t
-Time_zone_utc::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_utc::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
/* Should be never called */
DBUG_ASSERT(0);
@@ -1144,7 +1144,7 @@
public:
Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg);
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
private:
@@ -1193,7 +1193,7 @@
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_db::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap);
}
@@ -1240,7 +1240,7 @@
public:
Time_zone_offset(long tz_offset_arg);
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const;
+ my_bool *in_dst_time_gap) const;
virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const;
virtual const String * get_name() const;
/*
@@ -1292,7 +1292,7 @@
Corresponding my_time_t value or 0 in case of error
*/
my_time_t
-Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const
+Time_zone_offset::TIME_to_gmt_sec(const TIME *t, my_bool *in_dst_time_gap) const
{
return sec_since_epoch(t->year, t->month, t->day,
t->hour, t->minute, t->second) -
@@ -2549,8 +2549,6 @@
time_t t, t1, t2;
char fullname[FN_REFLEN+1];
char *str_end;
- long not_used;
- bool not_used_2;
MEM_ROOT tz_storage;
MY_INIT(argv[0]);
@@ -2660,14 +2658,21 @@
dates.
*/
for (time_tmp.year= 1980; time_tmp.year < 2010; time_tmp.year++)
+ {
for (time_tmp.month= 1; time_tmp.month < 13; time_tmp.month++)
+ {
for (time_tmp.day= 1;
time_tmp.day < mon_lengths[isleap(time_tmp.year)][time_tmp.month-1];
time_tmp.day++)
+ {
for (time_tmp.hour= 0; time_tmp.hour < 24; time_tmp.hour++)
+ {
for (time_tmp.minute= 0; time_tmp.minute < 60; time_tmp.minute+= 5)
+ {
for (time_tmp.second=0; time_tmp.second<60; time_tmp.second+=25)
{
+ long not_used;
+ my_bool not_used_2;
t= (time_t)my_system_gmt_sec(&time_tmp, ¬_used,
¬_used_2);
t1= (time_t)TIME_to_gmt_sec(&time_tmp, &tz_info, ¬_used_2);
if (t != t1)
@@ -2699,6 +2704,11 @@
return 1;
}
}
+ }
+ }
+ }
+ }
+ }
printf("TIME_to_gmt_sec = my_system_gmt_sec for test range\n");
--- 1.11/sql/tztime.h 2005-05-09 12:26:47 +03:00
+++ 1.12/sql/tztime.h 2005-07-31 12:49:47 +03:00
@@ -37,7 +37,7 @@
falls into spring time-gap (or lefts it untouched otherwise).
*/
virtual my_time_t TIME_to_gmt_sec(const TIME *t,
- bool *in_dst_time_gap) const = 0;
+ my_bool *in_dst_time_gap) const = 0;
/*
Converts time in my_time_t representation to local time in
broken down TIME representation.
--- 1.24/sql/sql_trigger.cc 2005-07-28 23:57:51 +03:00
+++ 1.25/sql/sql_trigger.cc 2005-07-31 12:49:47 +03:00
@@ -226,7 +226,7 @@
/* Trigger must be in the same schema as target table. */
- if (my_strcasecmp(system_charset_info, table->s->db,
+ if (my_strcasecmp(table_alias_charset, table->s->db,
lex->spname->m_db.str ? lex->spname->m_db.str :
thd->db))
{
@@ -396,7 +396,7 @@
{
it_def++;
- if (my_strcasecmp(system_charset_info, lex->spname->m_name.str,
+ if (my_strcasecmp(table_alias_charset, lex->spname->m_name.str,
name->str) == 0)
{
/*
@@ -541,8 +541,7 @@
if ((parser= sql_parse_prepare(&path, &table->mem_root, 1)))
{
- if (!strncmp(triggers_file_type.str, parser->type()->str,
- parser->type()->length))
+ if (is_equal(&triggers_file_type, parser->type()))
{
Table_triggers_list *triggers=
new (&table->mem_root) Table_triggers_list(table);
@@ -601,7 +600,8 @@
triggers->bodies[lex.trg_chistics.event]
[lex.trg_chistics.action_time]= lex.sphead;
- if (triggers->names_list.push_back(&lex.sphead->m_name,
&table->mem_root))
+ if (triggers->names_list.push_back(&lex.sphead->m_name,
+ &table->mem_root))
goto err_with_lex_cleanup;
if (names_only)
@@ -615,8 +615,9 @@
in old/new versions of row in trigger to Field objects in table being
opened.
- We ignore errors here, because if even something is wrong we still will
- be willing to open table to perform some operations (e.g. SELECT)...
+ We ignore errors here, because if even something is wrong we still
+ will be willing to open table to perform some operations
+ (e.g. SELECT)...
Anyway some things can be checked only during trigger execution.
*/
for (Item_trigger_field *trg_field=
@@ -647,7 +648,7 @@
be merged into .FRM anyway.
*/
my_error(ER_WRONG_OBJECT, MYF(0),
- table_name, triggers_file_ext, "TRIGGER");
+ table_name, triggers_file_ext+1, "TRIGGER");
DBUG_RETURN(1);
}
@@ -726,10 +727,9 @@
if (!(parser= sql_parse_prepare(&path, thd->mem_root, 1)))
DBUG_RETURN(0);
- if (strncmp(trigname_file_type.str, parser->type()->str,
- parser->type()->length))
+ if (!is_equal(&trigname_file_type, parser->type()))
{
- my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext,
+ my_error(ER_WRONG_OBJECT, MYF(0), trig->m_name.str, trigname_file_ext+1,
"TRIGGERNAME");
DBUG_RETURN(0);
}
--- 1.46/mysql-test/t/information_schema.test 2005-07-27 14:17:00 +03:00
+++ 1.47/mysql-test/t/information_schema.test 2005-07-31 12:49:46 +03:00
@@ -249,25 +249,27 @@
# QQ This results in NULLs instead of the version numbers when
# QQ a LOCK TABLES is in effect when selecting from
-# QQ information_schema.tables. Until this bug has been fixed,
-# QQ this test is disabled /pem
-#delimiter //;
-#create procedure px5 ()
-#begin
-#declare v int;
-#declare c cursor for select version from
-#information_schema.tables where table_schema <> 'information_schema';
-#open c;
-#fetch c into v;
-#select v;
-#close c;
-#end;//
-#
-#call px5()//
-#call px5()//
-#delimiter ;//
-#select sql_mode from information_schema.ROUTINES;
-#drop procedure px5;
+# QQ information_schema.tables.
+
+--disable_parsing until bug is fixes
+delimiter //;
+create procedure px5 ()
+begin
+declare v int;
+declare c cursor for select version from
+information_schema.tables where table_schema <> 'information_schema';
+open c;
+fetch c into v;
+select v;
+close c;
+end;//
+
+call px5()//
+call px5()//
+delimiter ;//
+select sql_mode from information_schema.ROUTINES;
+drop procedure px5;
+--enable_parsing
create table t1 (a int not null auto_increment,b int, primary key (a));
insert into t1 values (1,1),(NULL,3),(NULL,4);
--- 1.10/mysql-test/lib/init_db.sql 2005-07-19 04:35:36 +03:00
+++ 1.11/mysql-test/lib/init_db.sql 2005-07-31 12:49:46 +03:00
@@ -504,7 +504,7 @@
CREATE TABLE proc (
- db char(64) binary DEFAULT '' NOT NULL,
+ db char(64) collate utf8_bin DEFAULT '' NOT NULL,
name char(64) DEFAULT '' NOT NULL,
type enum('FUNCTION','PROCEDURE') NOT NULL,
specific_name char(64) DEFAULT '' NOT NULL,
@@ -519,7 +519,7 @@
param_list blob DEFAULT '' NOT NULL,
returns char(64) DEFAULT '' NOT NULL,
body blob DEFAULT '' NOT NULL,
- definer char(77) binary DEFAULT '' NOT NULL,
+ definer char(77) collate utf8_bin DEFAULT '' NOT NULL,
created timestamp,
modified timestamp,
sql_mode set(
@@ -554,6 +554,6 @@
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL,
- comment char(64) binary DEFAULT '' NOT NULL,
+ comment char(64) collate utf8_bin DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
-) comment='Stored Procedures';
+) character set utf8 comment='Stored Procedures';
--- 1.7/mysql-test/r/mysqltest.result 2005-06-16 13:46:05 +03:00
+++ 1.8/mysql-test/r/mysqltest.result 2005-07-31 12:49:46 +03:00
@@ -164,3 +164,5 @@
. - is longer then 80 characters and
. - consists of several lines
--------------------------------------------------------------------------------
+this will be executed
+this will be executed
--- 1.8/mysql-test/t/mysqltest.test 2005-07-28 17:09:48 +03:00
+++ 1.9/mysql-test/t/mysqltest.test 2005-07-31 12:49:46 +03:00
@@ -324,3 +324,14 @@
. - consists of several lines;
--source include/show_msg80.inc
+#
+# Test --enable_parsning / disable_parsning
+#
+--disable_query_log
+--disable_parsing
+# The following will not enable query logging
+--enable_query_log
+select "this will not be executed";
+--enable_parsing
+select "this will be executed";
+--enable_query_log
--- 1.10/include/my_time.h 2005-07-19 02:12:40 +03:00
+++ 1.11/include/my_time.h 2005-07-31 12:49:46 +03:00
@@ -60,8 +60,8 @@
ulonglong TIME_to_ulonglong(const MYSQL_TIME *time);
-bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
- int *was_cut);
+my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
+ int *was_cut);
long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
@@ -69,7 +69,8 @@
void init_time(void);
my_time_t
-my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap);
+my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
+ my_bool *in_dst_time_gap);
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
--- 1.14/sql-common/my_time.c 2005-07-19 02:12:41 +03:00
+++ 1.15/sql-common/my_time.c 2005-07-31 12:49:46 +03:00
@@ -60,11 +60,11 @@
SYNOPSIS
check_date()
- ltime - Date to check.
- not_zero_date - ltime is not the zero date
- flags - flags to check
- was_cut - set to whether the value was truncated
-
+ ltime Date to check.
+ not_zero_date ltime is not the zero date
+ flags flags to check
+ was_cut set to 2 if value was truncated.
+ NOTE: This is not touched if value was not truncated
NOTES
Here we assume that year and month is ok !
If month is 0 we allow any date. (This only happens if we allow zero
@@ -75,10 +75,9 @@
1 error
*/
-bool check_date(const MYSQL_TIME *ltime, bool not_zero_date, ulong flags,
- int *was_cut)
+static my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
+ ulong flags, int *was_cut)
{
-
if (not_zero_date)
{
if ((((flags & TIME_NO_ZERO_IN_DATE) || !(flags & TIME_FUZZY_DATE))
&&
@@ -165,11 +164,11 @@
uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS];
uint add_hours= 0, start_loop;
ulong not_zero_date, allow_space;
- bool is_internal_format;
+ my_bool is_internal_format;
const char *pos, *last_field_pos;
const char *end=str+length;
const uchar *format_position;
- bool found_delimitier= 0, found_space= 0;
+ my_bool found_delimitier= 0, found_space= 0;
uint frac_pos, frac_len;
DBUG_ENTER("str_to_datetime");
DBUG_PRINT("ENTER",("str: %.*s",length,str));
@@ -472,12 +471,12 @@
1 error
*/
-bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
- int *was_cut)
+my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
+ int *was_cut)
{
long date[5],value;
const char *end=str+length, *end_of_days;
- bool found_days,found_hours;
+ my_bool found_days,found_hours;
uint state;
l_time->neg=0;
@@ -644,7 +643,7 @@
time_t seconds;
struct tm *l_time,tm_tmp;
MYSQL_TIME my_time;
- bool not_used;
+ my_bool not_used;
seconds= (time_t) time((time_t*) 0);
localtime_r(&seconds,&tm_tmp);
@@ -710,7 +709,8 @@
Time in UTC seconds since Unix Epoch representation.
*/
my_time_t
-my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap)
+my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
+ my_bool *in_dst_time_gap)
{
uint loop;
time_t tmp;
@@ -961,11 +961,10 @@
return nr;
/* Don't want to have was_cut get set if NO_ZERO_DATE was violated. */
- if (!nr && flags & TIME_NO_ZERO_DATE)
+ if (!nr && (flags & TIME_NO_ZERO_DATE))
return LL(-1);
err:
-
*was_cut= 1;
return LL(-1);
}
--- 1.67/mysql-test/r/variables.result 2005-07-23 02:18:28 +03:00
+++ 1.68/mysql-test/r/variables.result 2005-07-31 12:49:46 +03:00
@@ -526,14 +526,14 @@
set @@global.error_count=1;
ERROR HY000: Variable 'error_count' is a read only variable
set @@max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
-@@max_heap_table_size
-4294967296
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
set global max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
-@@max_heap_table_size
-4294967296
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
set @@max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
-@@max_heap_table_size
-4294967296
+select @@max_heap_table_size > 0;
+@@max_heap_table_size > 0
+1
--- 1.44/mysql-test/t/variables.test 2005-07-28 23:57:51 +03:00
+++ 1.45/mysql-test/t/variables.test 2005-07-31 12:49:46 +03:00
@@ -413,8 +413,9 @@
# Bug #10351: Setting max_heap_table_size to 4G fails
#
set @@max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
+select @@max_heap_table_size > 0;
set global max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
+select @@max_heap_table_size > 0;
set @@max_heap_table_size= 4294967296;
-select @@max_heap_table_size;
+select @@max_heap_table_size > 0;
+
--- 1.37/client/client_priv.h 2005-05-26 13:58:50 +03:00
+++ 1.38/client/client_priv.h 2005-07-31 12:49:45 +03:00
@@ -49,5 +49,6 @@
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
#endif
- OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE
+ OPT_TRIGGERS,
+ OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
};
--- 1.126/sql/set_var.cc 2005-07-23 02:18:28 +03:00
+++ 1.127/sql/set_var.cc 2005-07-31 12:49:47 +03:00
@@ -1426,6 +1426,12 @@
if ((ulong) tmp > max_system_variables.*offset)
tmp= max_system_variables.*offset;
+#if SIZEOF_LONG == 4
+ /* Avoid overflows on 32 bit systems */
+ if (tmp > (ulonglong) ~(ulong) 0)
+ tmp= ((ulonglong) ~(ulong) 0);
+#endif
+
if (option_limits)
tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
if (var->type == OPT_GLOBAL)
@@ -1679,7 +1685,7 @@
pthread_mutex_lock(&LOCK_global_system_variables);
value= *(uint*) value_ptr(thd, var_type, base);
pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint((uint32) value);
+ return new Item_uint((ulonglong) value);
}
case SHOW_LONG:
{
@@ -1687,7 +1693,7 @@
pthread_mutex_lock(&LOCK_global_system_variables);
value= *(ulong*) value_ptr(thd, var_type, base);
pthread_mutex_unlock(&LOCK_global_system_variables);
- return new Item_uint(value);
+ return new Item_uint((ulonglong) value);
}
case SHOW_LONGLONG:
{
--- 1.151/client/mysqltest.c 2005-07-18 23:49:14 +03:00
+++ 1.152/client/mysqltest.c 2005-07-31 12:49:46 +03:00
@@ -42,7 +42,7 @@
**********************************************************************/
-#define MTEST_VERSION "2.4"
+#define MTEST_VERSION "2.5"
#include <my_global.h>
#include <mysql_embed.h>
@@ -151,6 +151,7 @@
static int port = 0;
static my_bool opt_big_test= 0, opt_compress= 0, silent= 0, verbose = 0;
static my_bool tty_password= 0, ps_protocol= 0, ps_protocol_enabled= 0;
+static int parsing_disabled= 0;
static uint start_lineno, *lineno;
const char* manager_user="root",*manager_host=0;
char *manager_pass=0;
@@ -308,6 +309,7 @@
Q_EXIT,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
Q_IF,
+Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -399,6 +401,8 @@
"disable_reconnect",
"enable_reconnect",
"if",
+ "disable_parsing",
+ "enable_parsing",
0
};
@@ -2141,7 +2145,7 @@
}
break;
case R_LINE_START:
- if (c == '#' || c == '-')
+ if (c == '#' || c == '-' || parsing_disabled)
{
state = R_COMMENT;
}
@@ -2268,18 +2272,22 @@
/* This goto is to avoid losing the "expected error" info. */
goto end;
}
- memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
- sizeof(global_expected_errno));
- q->expected_errors= global_expected_errors;
- q->abort_on_error= (global_expected_errors == 0 && abort_on_error);
- bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
- global_expected_errors=0;
+ if (!parsing_disabled)
+ {
+ memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
+ sizeof(global_expected_errno));
+ q->expected_errors= global_expected_errors;
+ q->abort_on_error= (global_expected_errors == 0 && abort_on_error);
+ bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
+ global_expected_errors=0;
+ }
+
if (p[0] == '-' && p[1] == '-')
{
q->type= Q_COMMENT_WITH_COMMAND;
p+= 2; /* To calculate first word */
}
- else
+ else if (!parsing_disabled)
{
if (*p == '!')
{
@@ -3586,20 +3594,29 @@
uint type;
DBUG_ENTER("get_query_type");
- if (*q->query == '}')
+ if (!parsing_disabled && *q->query == '}')
{
q->type = Q_END_BLOCK;
DBUG_VOID_RETURN;
}
if (q->type != Q_COMMENT_WITH_COMMAND)
- q->type = Q_QUERY;
+ q->type= parsing_disabled ? Q_COMMENT : Q_QUERY;
save=q->query[q->first_word_len];
q->query[q->first_word_len]=0;
type=find_type(q->query, &command_typelib, 1+2);
q->query[q->first_word_len]=save;
if (type > 0)
+ {
q->type=(enum enum_commands) type; /* Found command */
+ /*
+ If queries are disabled, only recognize
+ --enable-queries and --disable-queries
+ */
+ if (parsing_disabled && q->type != Q_ENABLE_PARSING &&
+ q->type != Q_DISABLE_PARSING)
+ q->type= Q_COMMENT;
+ }
DBUG_VOID_RETURN;
}
@@ -3962,6 +3979,17 @@
break;
case Q_ENABLE_RECONNECT:
cur_con->mysql.reconnect= 1;
+ break;
+ case Q_DISABLE_PARSING:
+ parsing_disabled++;
+ break;
+ case Q_ENABLE_PARSING:
+ /*
+ Ensure we don't get parsing_disabled < 0 as this would accidently
+ disable code we don't want to have disabled
+ */
+ if (parsing_disabled > 0)
+ parsing_disabled--;
break;
case Q_EXIT:
--- 1.134/mysql-test/t/sp.test 2005-07-22 09:11:17 +03:00
+++ 1.135/mysql-test/t/sp.test 2005-07-31 12:49:46 +03:00
@@ -1232,12 +1232,14 @@
end|
select f5(1)|
# This should generate an error about insuficient number of tables locked
-# Nuw this crash server, comented until bug#11394 fix
-#--error 1100
-#select f5(2)|
+# Now this crash server
+--disable_parsing until bug#11394 fix
+--error 1100
+select f5(2)|
# But now it simply miserably fails because we are trying to use the same
# lex on the next iteration :/ It should generate some error too...
-# select f5(3)|
+select f5(3)|
+--enable_parsing
# OTOH this should work
create function f6() returns int
@@ -1285,9 +1287,11 @@
return (select sum(data) from t1) + (select sum(data) from v1)|
# This queries will crash server because we can't use LEX in
# reenterable fashion yet. Patch disabling recursion will heal this.
-#select f1()|
-#select * from v1|
-#select * from v2|
+--disable_parsing
+select f1()|
+select * from v1|
+select * from v2|
+--enable_parsing
# Back to the normal cases
drop function f1|
create function f1() returns int
@@ -1499,54 +1503,55 @@
#
# This part of test is disabled until we implement support for
# recursive stored procedures.
-#--disable_warnings
-#drop table if exists fib|
-#--enable_warnings
-#create table fib ( 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 fib order by f desc limit 2;
-#
-# open c;
-# fetch c into y;
-# fetch c into x;
-# close c;
-# insert into fib values (x+y);
-# call fib(n-1);
-# end;
-# end if;
-#end|
-#
-## Minimum test: recursion of 3 levels
-#
-#insert into fib values (0), (1)|
-#
-#call fib(3)|
-#
-#select * from fib order by f asc|
-#
-#delete from fib|
-#
-## Original test: 20 levels (may run into memory limits!)
-#
-#insert into fib values (0), (1)|
-#
-#call fib(20)|
-#
-#select * from fib order by f asc|
-#drop table fib|
-#drop procedure fib|
+--disable_parsing
+--disable_warnings
+drop table if exists fib|
+--enable_warnings
+create table fib ( 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 fib order by f desc limit 2;
+
+ open c;
+ fetch c into y;
+ fetch c into x;
+ close c;
+ insert into fib values (x+y);
+ call fib(n-1);
+ end;
+ end if;
+end|
+
+# Minimum test: recursion of 3 levels
+
+insert into fib values (0), (1)|
+
+call fib(3)|
+
+select * from fib order by f asc|
+
+delete from fib|
+
+# Original test: 20 levels (may run into memory limits!)
+insert into fib values (0), (1)|
+
+call fib(20)|
+
+select * from fib order by f asc|
+drop table fib|
+drop procedure fib|
+--enable_parsing
#
# Comment & suid
@@ -1830,49 +1835,51 @@
# FIXME: Other solution would be to use preopened proc table
# instead of opening it anew.
#
-#--disable_warnings
-#drop procedure if exists bug2267_1|
-#--enable_warnings
-#create procedure bug2267_1()
-#begin
-# show procedure status;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_2|
-#--enable_warnings
-#create procedure bug2267_2()
-#begin
-# show function status;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_3|
-#--enable_warnings
-#create procedure bug2267_3()
-#begin
-# show create procedure bug2267_1;
-#end|
-#
-#--disable_warnings
-#drop procedure if exists bug2267_4|
-#--enable_warnings
-#create procedure bug2267_4()
-#begin
-# show create function fac;
-#end|
-#
-#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-#call bug2267_1()|
-#--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
-#call bug2267_2()|
-#call bug2267_3()|
-#call bug2267_4()|
-#
-#drop procedure bug2267_1|
-#drop procedure bug2267_2|
-#drop procedure bug2267_3|
-#drop procedure bug2267_4|
+--disable_parsing
+--disable_warnings
+drop procedure if exists bug2267_1|
+--enable_warnings
+create procedure bug2267_1()
+begin
+ show procedure status;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_2|
+--enable_warnings
+create procedure bug2267_2()
+begin
+ show function status;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_3|
+--enable_warnings
+create procedure bug2267_3()
+begin
+ show create procedure bug2267_1;
+end|
+
+--disable_warnings
+drop procedure if exists bug2267_4|
+--enable_warnings
+create procedure bug2267_4()
+begin
+ show create function fac;
+end|
+
+--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+call bug2267_1()|
+--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
+call bug2267_2()|
+call bug2267_3()|
+call bug2267_4()|
+
+drop procedure bug2267_1|
+drop procedure bug2267_2|
+drop procedure bug2267_3|
+drop procedure bug2267_4|
+--enable_parsing
#
# BUG#2227
@@ -1901,23 +1908,25 @@
# QQ For this reason we can't run this test any more (i.e., if we modify
# QQ it, it's no longer a test case for the bug), but we keep it here
# QQ anyway, for tracability.
-#--disable_warnings
-#drop procedure if exists bug2614|
-#--enable_warnings
-#create procedure bug2614()
-#begin
-# drop temporary table if exists t3;
-# create temporary table t3 (id int default '0' not null);
-# insert into t3 select 12;
-# insert into t3 select * from t3;
-#end|
-#
-#--disable_warnings
-#call bug2614()|
-#--enable_warnings
-#call bug2614()|
-#drop temporary table t3|
-#drop procedure bug2614|
+--disable_parsing
+--disable_warnings
+drop procedure if exists bug2614|
+--enable_warnings
+create procedure bug2614()
+begin
+ drop temporary table if exists t3;
+ create temporary table t3 (id int default '0' not null);
+ insert into t3 select 12;
+ insert into t3 select * from t3;
+end|
+
+--disable_warnings
+call bug2614()|
+--enable_warnings
+call bug2614()|
+drop temporary table t3|
+drop procedure bug2614|
+--enable_parsing
#
# BUG#2674
@@ -2508,27 +2517,29 @@
# BUG#4318
#
#QQ Don't know if HANDLER commands can work with SPs, or at all...
-#--disable_warnings
-#drop table if exists t3|
-#--enable_warnings
-#
-#create table t3 (s1 int)|
-#insert into t3 values (3), (4)|
-#
-#--disable_warnings
-#drop procedure if exists bug4318|
-#--enable_warnings
-#create procedure bug4318()
-# handler t3 read next|
-#
-#handler t3 open|
-## Expect no results, as tables are closed, but there shouldn't be any errors
-#call bug4318()|
-#call bug4318()|
-#handler t3 close|
-#
-#drop procedure bug4318|
-#drop table t3|
+--disable_parsing
+--disable_warnings
+drop table if exists t3|
+--enable_warnings
+
+create table t3 (s1 int)|
+insert into t3 values (3), (4)|
+
+--disable_warnings
+drop procedure if exists bug4318|
+--enable_warnings
+create procedure bug4318()
+ handler t3 read next|
+
+handler t3 open|
+# Expect no results, as tables are closed, but there shouldn't be any errors
+call bug4318()|
+call bug4318()|
+handler t3 close|
+
+drop procedure bug4318|
+drop table t3|
+--enable_parsing
#
# BUG#4902: Stored procedure with SHOW WARNINGS leads to packet error
@@ -2563,11 +2574,13 @@
show variables like 'foo';
show warnings;
end|
-#show binlog events;
-#show storage engines;
-#show master status;
-#show slave hosts;
-#show slave status;
+--disable_parsing
+show binlog events;
+show storage engines;
+show master status;
+show slave hosts;
+show slave status;
+--enable_parsing
call bug4902()|
call bug4902()|
@@ -3911,7 +3924,6 @@
#drop procedure if exists bugNNNN|
#--enable_warnings
#create procedure bugNNNN...
-
# Add bugs above this line. Use existing tables t1 and t2 when
# practical, or create table t3, t4 etc temporarily (and drop them).
| Thread |
|---|
| • bk commit into 5.0 tree (monty:1.1917) | monty | 31 Jul |